mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
f2fs: Pass a folio to f2fs_allocate_data_block()
Most callers pass NULL, and the one which passes a page already has a folio, so we can pass it in. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
61fcaf3eb8
commit
c3c06275e4
|
|
@ -3858,7 +3858,7 @@ void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
|
|||
bool recover_newaddr);
|
||||
enum temp_type f2fs_get_segment_temp(struct f2fs_sb_info *sbi,
|
||||
enum log_type seg_type);
|
||||
int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||
int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct folio *folio,
|
||||
block_t old_blkaddr, block_t *new_blkaddr,
|
||||
struct f2fs_summary *sum, int type,
|
||||
struct f2fs_io_info *fio);
|
||||
|
|
|
|||
|
|
@ -3747,7 +3747,7 @@ static void f2fs_randomize_chunk(struct f2fs_sb_info *sbi,
|
|||
get_random_u32_inclusive(1, sbi->max_fragment_hole);
|
||||
}
|
||||
|
||||
int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||
int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct folio *folio,
|
||||
block_t old_blkaddr, block_t *new_blkaddr,
|
||||
struct f2fs_summary *sum, int type,
|
||||
struct f2fs_io_info *fio)
|
||||
|
|
@ -3851,10 +3851,10 @@ int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
|||
|
||||
up_write(&sit_i->sentry_lock);
|
||||
|
||||
if (page && IS_NODESEG(curseg->seg_type)) {
|
||||
fill_node_footer_blkaddr(page, NEXT_FREE_BLKADDR(sbi, curseg));
|
||||
if (folio && IS_NODESEG(curseg->seg_type)) {
|
||||
fill_node_footer_blkaddr(&folio->page, NEXT_FREE_BLKADDR(sbi, curseg));
|
||||
|
||||
f2fs_inode_chksum_set(sbi, page);
|
||||
f2fs_inode_chksum_set(sbi, &folio->page);
|
||||
}
|
||||
|
||||
if (fio) {
|
||||
|
|
@ -3941,7 +3941,7 @@ static void do_write_page(struct f2fs_summary *sum, struct f2fs_io_info *fio)
|
|||
if (keep_order)
|
||||
f2fs_down_read(&fio->sbi->io_order_lock);
|
||||
|
||||
if (f2fs_allocate_data_block(fio->sbi, fio->page, fio->old_blkaddr,
|
||||
if (f2fs_allocate_data_block(fio->sbi, folio, fio->old_blkaddr,
|
||||
&fio->new_blkaddr, sum, type, fio)) {
|
||||
if (fscrypt_inode_uses_fs_layer_crypto(folio->mapping->host))
|
||||
fscrypt_finalize_bounce_page(&fio->encrypted_page);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user