f2fs: clean up parameter of f2fs_allocate_data_block()
Use validation of @fio to inidcate whether caller want to serialize IOs in io.io_list or not, then @add_list will be redundant, remove it. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
79963d967b
commit
f608c38c59
4 changed files with 6 additions and 6 deletions
|
@ -1366,7 +1366,7 @@ alloc:
|
||||||
set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);
|
set_summary(&sum, dn->nid, dn->ofs_in_node, ni.version);
|
||||||
old_blkaddr = dn->data_blkaddr;
|
old_blkaddr = dn->data_blkaddr;
|
||||||
f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr,
|
f2fs_allocate_data_block(sbi, NULL, old_blkaddr, &dn->data_blkaddr,
|
||||||
&sum, seg_type, NULL, false);
|
&sum, seg_type, NULL);
|
||||||
if (GET_SEGNO(sbi, old_blkaddr) != NULL_SEGNO)
|
if (GET_SEGNO(sbi, old_blkaddr) != NULL_SEGNO)
|
||||||
invalidate_mapping_pages(META_MAPPING(sbi),
|
invalidate_mapping_pages(META_MAPPING(sbi),
|
||||||
old_blkaddr, old_blkaddr);
|
old_blkaddr, old_blkaddr);
|
||||||
|
|
|
@ -3350,7 +3350,7 @@ void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
|
||||||
void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||||
block_t old_blkaddr, block_t *new_blkaddr,
|
block_t old_blkaddr, block_t *new_blkaddr,
|
||||||
struct f2fs_summary *sum, int type,
|
struct f2fs_summary *sum, int type,
|
||||||
struct f2fs_io_info *fio, bool add_list);
|
struct f2fs_io_info *fio);
|
||||||
void f2fs_wait_on_page_writeback(struct page *page,
|
void f2fs_wait_on_page_writeback(struct page *page,
|
||||||
enum page_type type, bool ordered, bool locked);
|
enum page_type type, bool ordered, bool locked);
|
||||||
void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr);
|
void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr);
|
||||||
|
|
|
@ -866,7 +866,7 @@ static int move_data_block(struct inode *inode, block_t bidx,
|
||||||
}
|
}
|
||||||
|
|
||||||
f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,
|
f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,
|
||||||
&sum, CURSEG_COLD_DATA, NULL, false);
|
&sum, CURSEG_COLD_DATA, NULL);
|
||||||
|
|
||||||
fio.encrypted_page = f2fs_pagecache_get_page(META_MAPPING(fio.sbi),
|
fio.encrypted_page = f2fs_pagecache_get_page(META_MAPPING(fio.sbi),
|
||||||
newaddr, FGP_LOCK | FGP_CREAT, GFP_NOFS);
|
newaddr, FGP_LOCK | FGP_CREAT, GFP_NOFS);
|
||||||
|
|
|
@ -3115,7 +3115,7 @@ static int __get_segment_type(struct f2fs_io_info *fio)
|
||||||
void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||||
block_t old_blkaddr, block_t *new_blkaddr,
|
block_t old_blkaddr, block_t *new_blkaddr,
|
||||||
struct f2fs_summary *sum, int type,
|
struct f2fs_summary *sum, int type,
|
||||||
struct f2fs_io_info *fio, bool add_list)
|
struct f2fs_io_info *fio)
|
||||||
{
|
{
|
||||||
struct sit_info *sit_i = SIT_I(sbi);
|
struct sit_info *sit_i = SIT_I(sbi);
|
||||||
struct curseg_info *curseg = CURSEG_I(sbi, type);
|
struct curseg_info *curseg = CURSEG_I(sbi, type);
|
||||||
|
@ -3183,7 +3183,7 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
|
||||||
if (F2FS_IO_ALIGNED(sbi))
|
if (F2FS_IO_ALIGNED(sbi))
|
||||||
fio->retry = false;
|
fio->retry = false;
|
||||||
|
|
||||||
if (add_list) {
|
if (fio) {
|
||||||
struct f2fs_bio_info *io;
|
struct f2fs_bio_info *io;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&fio->list);
|
INIT_LIST_HEAD(&fio->list);
|
||||||
|
@ -3232,7 +3232,7 @@ static void do_write_page(struct f2fs_summary *sum, struct f2fs_io_info *fio)
|
||||||
down_read(&fio->sbi->io_order_lock);
|
down_read(&fio->sbi->io_order_lock);
|
||||||
reallocate:
|
reallocate:
|
||||||
f2fs_allocate_data_block(fio->sbi, fio->page, fio->old_blkaddr,
|
f2fs_allocate_data_block(fio->sbi, fio->page, fio->old_blkaddr,
|
||||||
&fio->new_blkaddr, sum, type, fio, true);
|
&fio->new_blkaddr, sum, type, fio);
|
||||||
if (GET_SEGNO(fio->sbi, fio->old_blkaddr) != NULL_SEGNO)
|
if (GET_SEGNO(fio->sbi, fio->old_blkaddr) != NULL_SEGNO)
|
||||||
invalidate_mapping_pages(META_MAPPING(fio->sbi),
|
invalidate_mapping_pages(META_MAPPING(fio->sbi),
|
||||||
fio->old_blkaddr, fio->old_blkaddr);
|
fio->old_blkaddr, fio->old_blkaddr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue