f2fs: change the unlock parameter of f2fs_put_page to bool
Change the type of the unlock parameter of f2fs_put_page to bool. All callers should consistently pass true or false. No logical change. Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>pull/1354/merge
parent
d33f89b34a
commit
89c16629e3
|
|
@ -120,7 +120,7 @@ static void f2fs_unlock_rpages(struct compress_ctx *cc, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void f2fs_put_rpages_wbc(struct compress_ctx *cc,
|
static void f2fs_put_rpages_wbc(struct compress_ctx *cc,
|
||||||
struct writeback_control *wbc, bool redirty, int unlock)
|
struct writeback_control *wbc, bool redirty, bool unlock)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
|
@ -1202,7 +1202,7 @@ bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
|
||||||
if (copied)
|
if (copied)
|
||||||
set_cluster_dirty(&cc);
|
set_cluster_dirty(&cc);
|
||||||
|
|
||||||
f2fs_put_rpages_wbc(&cc, NULL, false, 1);
|
f2fs_put_rpages_wbc(&cc, NULL, false, true);
|
||||||
f2fs_destroy_compress_ctx(&cc, false);
|
f2fs_destroy_compress_ctx(&cc, false);
|
||||||
|
|
||||||
return first_index;
|
return first_index;
|
||||||
|
|
@ -1605,7 +1605,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
|
||||||
add_compr_block_stat(cc->inode, cc->cluster_size);
|
add_compr_block_stat(cc->inode, cc->cluster_size);
|
||||||
goto write;
|
goto write;
|
||||||
} else if (err) {
|
} else if (err) {
|
||||||
f2fs_put_rpages_wbc(cc, wbc, true, 1);
|
f2fs_put_rpages_wbc(cc, wbc, true, true);
|
||||||
goto destroy_out;
|
goto destroy_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1619,7 +1619,7 @@ write:
|
||||||
f2fs_bug_on(F2FS_I_SB(cc->inode), *submitted);
|
f2fs_bug_on(F2FS_I_SB(cc->inode), *submitted);
|
||||||
|
|
||||||
err = f2fs_write_raw_pages(cc, submitted, wbc, io_type);
|
err = f2fs_write_raw_pages(cc, submitted, wbc, io_type);
|
||||||
f2fs_put_rpages_wbc(cc, wbc, false, 0);
|
f2fs_put_rpages_wbc(cc, wbc, false, false);
|
||||||
destroy_out:
|
destroy_out:
|
||||||
f2fs_destroy_compress_ctx(cc, false);
|
f2fs_destroy_compress_ctx(cc, false);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -3656,8 +3656,7 @@ repeat:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
put_folio:
|
put_folio:
|
||||||
folio_unlock(folio);
|
f2fs_folio_put(folio, true);
|
||||||
folio_put(folio);
|
|
||||||
fail:
|
fail:
|
||||||
f2fs_write_failed(inode, pos + len);
|
f2fs_write_failed(inode, pos + len);
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -3713,8 +3712,7 @@ static int f2fs_write_end(const struct kiocb *iocb,
|
||||||
pos + copied);
|
pos + copied);
|
||||||
}
|
}
|
||||||
unlock_out:
|
unlock_out:
|
||||||
folio_unlock(folio);
|
f2fs_folio_put(folio, true);
|
||||||
folio_put(folio);
|
|
||||||
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
|
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
|
||||||
return copied;
|
return copied;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2971,7 +2971,7 @@ static inline void f2fs_folio_put(struct folio *folio, bool unlock)
|
||||||
folio_put(folio);
|
folio_put(folio);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void f2fs_put_page(struct page *page, int unlock)
|
static inline void f2fs_put_page(struct page *page, bool unlock)
|
||||||
{
|
{
|
||||||
if (!page)
|
if (!page)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1278,7 +1278,7 @@ got_it:
|
||||||
err = f2fs_submit_page_bio(&fio);
|
err = f2fs_submit_page_bio(&fio);
|
||||||
if (err)
|
if (err)
|
||||||
goto put_encrypted_page;
|
goto put_encrypted_page;
|
||||||
f2fs_put_page(fio.encrypted_page, 0);
|
f2fs_put_page(fio.encrypted_page, false);
|
||||||
f2fs_folio_put(folio, true);
|
f2fs_folio_put(folio, true);
|
||||||
|
|
||||||
f2fs_update_iostat(sbi, inode, FS_DATA_READ_IO, F2FS_BLKSIZE);
|
f2fs_update_iostat(sbi, inode, FS_DATA_READ_IO, F2FS_BLKSIZE);
|
||||||
|
|
@ -1286,7 +1286,7 @@ got_it:
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
put_encrypted_page:
|
put_encrypted_page:
|
||||||
f2fs_put_page(fio.encrypted_page, 1);
|
f2fs_put_page(fio.encrypted_page, true);
|
||||||
put_folio:
|
put_folio:
|
||||||
f2fs_folio_put(folio, true);
|
f2fs_folio_put(folio, true);
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -1442,7 +1442,7 @@ static int move_data_block(struct inode *inode, block_t bidx,
|
||||||
f2fs_update_data_blkaddr(&dn, newaddr);
|
f2fs_update_data_blkaddr(&dn, newaddr);
|
||||||
set_inode_flag(inode, FI_APPEND_WRITE);
|
set_inode_flag(inode, FI_APPEND_WRITE);
|
||||||
|
|
||||||
f2fs_put_page(fio.encrypted_page, 1);
|
f2fs_put_page(fio.encrypted_page, true);
|
||||||
recover_block:
|
recover_block:
|
||||||
if (err)
|
if (err)
|
||||||
f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,
|
f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ int f2fs_write_inline_data(struct inode *inode, struct folio *folio)
|
||||||
set_inode_flag(inode, FI_DATA_EXIST);
|
set_inode_flag(inode, FI_DATA_EXIST);
|
||||||
|
|
||||||
folio_clear_f2fs_inline(ifolio);
|
folio_clear_f2fs_inline(ifolio);
|
||||||
f2fs_folio_put(ifolio, 1);
|
f2fs_folio_put(ifolio, true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -577,7 +577,7 @@ recover:
|
||||||
f2fs_i_depth_write(dir, 0);
|
f2fs_i_depth_write(dir, 0);
|
||||||
f2fs_i_size_write(dir, MAX_INLINE_DATA(dir));
|
f2fs_i_size_write(dir, MAX_INLINE_DATA(dir));
|
||||||
folio_mark_dirty(ifolio);
|
folio_mark_dirty(ifolio);
|
||||||
f2fs_folio_put(ifolio, 1);
|
f2fs_folio_put(ifolio, true);
|
||||||
|
|
||||||
kfree(backup_dentry);
|
kfree(backup_dentry);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -1249,11 +1249,11 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||||
return 0;
|
return 0;
|
||||||
out_new_dir:
|
out_new_dir:
|
||||||
if (new_dir_entry) {
|
if (new_dir_entry) {
|
||||||
f2fs_folio_put(new_dir_folio, 0);
|
f2fs_folio_put(new_dir_folio, false);
|
||||||
}
|
}
|
||||||
out_old_dir:
|
out_old_dir:
|
||||||
if (old_dir_entry) {
|
if (old_dir_entry) {
|
||||||
f2fs_folio_put(old_dir_folio, 0);
|
f2fs_folio_put(old_dir_folio, false);
|
||||||
}
|
}
|
||||||
out_new:
|
out_new:
|
||||||
f2fs_folio_put(new_folio, false);
|
f2fs_folio_put(new_folio, false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue