aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2025-02-18 05:51:54 +0000
committerJaegeuk Kim <jaegeuk@kernel.org>2025-03-04 17:02:26 +0000
commitb8fcb8423053adaa27723010260aea90474b431a (patch)
tree1e334704516bff672c80091dc0ec6361d4d8bcf3
parentf2fs: Use a folio throughout __get_meta_page() (diff)
downloadwireguard-linux-b8fcb8423053adaa27723010260aea90474b431a.tar.xz
wireguard-linux-b8fcb8423053adaa27723010260aea90474b431a.zip
f2fs: Hoist the page_folio() call to the start of f2fs_merge_page_bio()
Remove one call to compound_head() and a reference to page->mapping by calling page_folio() early on. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 383b97f30221..a7bd9b07235a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -888,6 +888,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio)
struct bio *bio = *fio->bio;
struct page *page = fio->encrypted_page ?
fio->encrypted_page : fio->page;
+ struct folio *folio = page_folio(fio->page);
if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr,
__is_meta_io(fio) ? META_GENERIC : DATA_GENERIC))
@@ -901,8 +902,8 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio)
alloc_new:
if (!bio) {
bio = __bio_alloc(fio, BIO_MAX_VECS);
- f2fs_set_bio_crypt_ctx(bio, fio->page->mapping->host,
- page_folio(fio->page)->index, fio, GFP_NOIO);
+ f2fs_set_bio_crypt_ctx(bio, folio->mapping->host,
+ folio->index, fio, GFP_NOIO);
add_bio_entry(fio->sbi, bio, page, fio->temp);
} else {
@@ -911,8 +912,7 @@ alloc_new:
}
if (fio->io_wbc)
- wbc_account_cgroup_owner(fio->io_wbc, page_folio(fio->page),
- PAGE_SIZE);
+ wbc_account_cgroup_owner(fio->io_wbc, folio, folio_size(folio));
inc_page_count(fio->sbi, WB_DATA_TYPE(page, false));