mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
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 <kasong@tencent.com> Cc: Jaegeuk Kim <jaegeuk@kernel.org> (maintainer:F2FS FILE SYSTEM) Cc: Chao Yu <chao@kernel.org> (maintainer:F2FS FILE SYSTEM) Cc: linux-f2fs-devel@lists.sourceforge.net (open list:F2FS FILE SYSTEM) Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
0244c77fed
commit
0427e811c9
|
|
@ -2078,7 +2078,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
|
|||
sector_t last_block;
|
||||
sector_t last_block_in_file;
|
||||
sector_t block_nr;
|
||||
pgoff_t index = folio_index(folio);
|
||||
pgoff_t index = folio->index;
|
||||
int ret = 0;
|
||||
|
||||
block_in_file = (sector_t)index;
|
||||
|
|
@ -2392,7 +2392,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
|
|||
}
|
||||
|
||||
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
||||
index = folio_index(folio);
|
||||
index = folio->index;
|
||||
|
||||
if (!f2fs_compressed_file(inode))
|
||||
goto read_single_page;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ void f2fs_do_read_inline_data(struct folio *folio, struct folio *ifolio)
|
|||
if (folio_test_uptodate(folio))
|
||||
return;
|
||||
|
||||
f2fs_bug_on(F2FS_I_SB(inode), folio_index(folio));
|
||||
f2fs_bug_on(F2FS_I_SB(inode), folio->index);
|
||||
|
||||
folio_zero_segment(folio, MAX_INLINE_DATA(inode), folio_size(folio));
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ int f2fs_read_inline_data(struct inode *inode, struct folio *folio)
|
|||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (folio_index(folio))
|
||||
if (folio->index)
|
||||
folio_zero_segment(folio, 0, folio_size(folio));
|
||||
else
|
||||
f2fs_do_read_inline_data(folio, ifolio);
|
||||
|
|
|
|||
|
|
@ -3432,7 +3432,7 @@ static int __f2fs_commit_super(struct f2fs_sb_info *sbi, struct folio *folio,
|
|||
bio = bio_alloc(sbi->sb->s_bdev, 1, opf, GFP_NOFS);
|
||||
|
||||
/* it doesn't need to set crypto context for superblock update */
|
||||
bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(folio_index(folio));
|
||||
bio->bi_iter.bi_sector = SECTOR_FROM_BLOCK(folio->index);
|
||||
|
||||
if (!bio_add_folio(bio, folio, folio_size(folio), 0))
|
||||
f2fs_bug_on(sbi, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user