Skip to content

Commit 89c1662

Browse files
Yongpeng YangJaegeuk Kim
authored andcommitted
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>
1 parent d33f89b commit 89c1662

6 files changed

Lines changed: 14 additions & 16 deletions

File tree

fs/f2fs/compress.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void f2fs_unlock_rpages(struct compress_ctx *cc, int len)
120120
}
121121

122122
static void f2fs_put_rpages_wbc(struct compress_ctx *cc,
123-
struct writeback_control *wbc, bool redirty, int unlock)
123+
struct writeback_control *wbc, bool redirty, bool unlock)
124124
{
125125
unsigned int i;
126126

@@ -1202,7 +1202,7 @@ bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
12021202
if (copied)
12031203
set_cluster_dirty(&cc);
12041204

1205-
f2fs_put_rpages_wbc(&cc, NULL, false, 1);
1205+
f2fs_put_rpages_wbc(&cc, NULL, false, true);
12061206
f2fs_destroy_compress_ctx(&cc, false);
12071207

12081208
return first_index;
@@ -1605,7 +1605,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
16051605
add_compr_block_stat(cc->inode, cc->cluster_size);
16061606
goto write;
16071607
} else if (err) {
1608-
f2fs_put_rpages_wbc(cc, wbc, true, 1);
1608+
f2fs_put_rpages_wbc(cc, wbc, true, true);
16091609
goto destroy_out;
16101610
}
16111611

@@ -1619,7 +1619,7 @@ int f2fs_write_multi_pages(struct compress_ctx *cc,
16191619
f2fs_bug_on(F2FS_I_SB(cc->inode), *submitted);
16201620

16211621
err = f2fs_write_raw_pages(cc, submitted, wbc, io_type);
1622-
f2fs_put_rpages_wbc(cc, wbc, false, 0);
1622+
f2fs_put_rpages_wbc(cc, wbc, false, false);
16231623
destroy_out:
16241624
f2fs_destroy_compress_ctx(cc, false);
16251625
return err;

fs/f2fs/data.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,8 +3656,7 @@ static int f2fs_write_begin(const struct kiocb *iocb,
36563656
return 0;
36573657

36583658
put_folio:
3659-
folio_unlock(folio);
3660-
folio_put(folio);
3659+
f2fs_folio_put(folio, true);
36613660
fail:
36623661
f2fs_write_failed(inode, pos + len);
36633662
return err;
@@ -3713,8 +3712,7 @@ static int f2fs_write_end(const struct kiocb *iocb,
37133712
pos + copied);
37143713
}
37153714
unlock_out:
3716-
folio_unlock(folio);
3717-
folio_put(folio);
3715+
f2fs_folio_put(folio, true);
37183716
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
37193717
return copied;
37203718
}

fs/f2fs/f2fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,7 @@ static inline void f2fs_folio_put(struct folio *folio, bool unlock)
29712971
folio_put(folio);
29722972
}
29732973

2974-
static inline void f2fs_put_page(struct page *page, int unlock)
2974+
static inline void f2fs_put_page(struct page *page, bool unlock)
29752975
{
29762976
if (!page)
29772977
return;

fs/f2fs/gc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,15 +1278,15 @@ static int ra_data_block(struct inode *inode, pgoff_t index)
12781278
err = f2fs_submit_page_bio(&fio);
12791279
if (err)
12801280
goto put_encrypted_page;
1281-
f2fs_put_page(fio.encrypted_page, 0);
1281+
f2fs_put_page(fio.encrypted_page, false);
12821282
f2fs_folio_put(folio, true);
12831283

12841284
f2fs_update_iostat(sbi, inode, FS_DATA_READ_IO, F2FS_BLKSIZE);
12851285
f2fs_update_iostat(sbi, NULL, FS_GDATA_READ_IO, F2FS_BLKSIZE);
12861286

12871287
return 0;
12881288
put_encrypted_page:
1289-
f2fs_put_page(fio.encrypted_page, 1);
1289+
f2fs_put_page(fio.encrypted_page, true);
12901290
put_folio:
12911291
f2fs_folio_put(folio, true);
12921292
return err;
@@ -1442,7 +1442,7 @@ static int move_data_block(struct inode *inode, block_t bidx,
14421442
f2fs_update_data_blkaddr(&dn, newaddr);
14431443
set_inode_flag(inode, FI_APPEND_WRITE);
14441444

1445-
f2fs_put_page(fio.encrypted_page, 1);
1445+
f2fs_put_page(fio.encrypted_page, true);
14461446
recover_block:
14471447
if (err)
14481448
f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,

fs/f2fs/inline.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ int f2fs_write_inline_data(struct inode *inode, struct folio *folio)
287287
set_inode_flag(inode, FI_DATA_EXIST);
288288

289289
folio_clear_f2fs_inline(ifolio);
290-
f2fs_folio_put(ifolio, 1);
290+
f2fs_folio_put(ifolio, true);
291291
return 0;
292292
}
293293

@@ -577,7 +577,7 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct folio *ifolio,
577577
f2fs_i_depth_write(dir, 0);
578578
f2fs_i_size_write(dir, MAX_INLINE_DATA(dir));
579579
folio_mark_dirty(ifolio);
580-
f2fs_folio_put(ifolio, 1);
580+
f2fs_folio_put(ifolio, true);
581581

582582
kfree(backup_dentry);
583583
return err;

fs/f2fs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,11 +1249,11 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
12491249
return 0;
12501250
out_new_dir:
12511251
if (new_dir_entry) {
1252-
f2fs_folio_put(new_dir_folio, 0);
1252+
f2fs_folio_put(new_dir_folio, false);
12531253
}
12541254
out_old_dir:
12551255
if (old_dir_entry) {
1256-
f2fs_folio_put(old_dir_folio, 0);
1256+
f2fs_folio_put(old_dir_folio, false);
12571257
}
12581258
out_new:
12591259
f2fs_folio_put(new_folio, false);

0 commit comments

Comments
 (0)