Skip to content

Commit 0427e81

Browse files
ryncsnJaegeuk Kim
authored andcommitted
f2fs: drop usage of folio_index
folio_index is only needed for mixed usage of page cache and swap cache, for pure page cache usage, the caller can just use folio->index instead. It can't be a swap cache folio here. Swap mapping may only call into fs through `swap_rw` but f2fs does not use that method for swap. Signed-off-by: Kairui Song <[email protected]> Cc: Jaegeuk Kim <[email protected]> (maintainer:F2FS FILE SYSTEM) Cc: Chao Yu <[email protected]> (maintainer:F2FS FILE SYSTEM) Cc: [email protected] (open list:F2FS FILE SYSTEM) Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 0244c77 commit 0427e81

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

fs/f2fs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
20782078
sector_t last_block;
20792079
sector_t last_block_in_file;
20802080
sector_t block_nr;
2081-
pgoff_t index = folio_index(folio);
2081+
pgoff_t index = folio->index;
20822082
int ret = 0;
20832083

20842084
block_in_file = (sector_t)index;
@@ -2392,7 +2392,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
23922392
}
23932393

23942394
#ifdef CONFIG_F2FS_FS_COMPRESSION
2395-
index = folio_index(folio);
2395+
index = folio->index;
23962396

23972397
if (!f2fs_compressed_file(inode))
23982398
goto read_single_page;

fs/f2fs/inline.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void f2fs_do_read_inline_data(struct folio *folio, struct folio *ifolio)
8686
if (folio_test_uptodate(folio))
8787
return;
8888

89-
f2fs_bug_on(F2FS_I_SB(inode), folio_index(folio));
89+
f2fs_bug_on(F2FS_I_SB(inode), folio->index);
9090

9191
folio_zero_segment(folio, MAX_INLINE_DATA(inode), folio_size(folio));
9292

@@ -130,7 +130,7 @@ int f2fs_read_inline_data(struct inode *inode, struct folio *folio)
130130
return -EAGAIN;
131131
}
132132

133-
if (folio_index(folio))
133+
if (folio->index)
134134
folio_zero_segment(folio, 0, folio_size(folio));
135135
else
136136
f2fs_do_read_inline_data(folio, ifolio);

fs/f2fs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3432,7 +3432,7 @@ static int __f2fs_commit_super(struct f2fs_sb_info *sbi, struct folio *folio,
34323432
bio = bio_alloc(sbi->sb->s_bdev, 1, opf, GFP_NOFS);
34333433

34343434
/* it doesn't need to set crypto context for superblock update */
3435-
bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(folio_index(folio));
3435+
bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(folio->index);
34363436

34373437
if (!bio_add_folio(bio, folio, folio_size(folio), 0))
34383438
f2fs_bug_on(sbi, 1);

0 commit comments

Comments
 (0)