Skip to content

Commit 5e2a00e

Browse files
Matthew Wilcox (Oracle)Jaegeuk Kim
authored andcommitted
f2fs: Use a folio in f2fs_merge_page_bio()
We have two folios to deal with here; one carries the metadata and the other points to the data. They may be the same, but if it's compressed, the data_folio will differ from the metadata folio. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent ca8049c commit 5e2a00e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

fs/f2fs/data.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -886,15 +886,15 @@ void f2fs_submit_merged_ipu_write(struct f2fs_sb_info *sbi,
886886
int f2fs_merge_page_bio(struct f2fs_io_info *fio)
887887
{
888888
struct bio *bio = *fio->bio;
889-
struct page *page = fio->encrypted_page ?
890-
fio->encrypted_page : fio->page;
889+
struct folio *data_folio = fio->encrypted_page ?
890+
page_folio(fio->encrypted_page) : fio->folio;
891891
struct folio *folio = fio->folio;
892892

893893
if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr,
894894
__is_meta_io(fio) ? META_GENERIC : DATA_GENERIC))
895895
return -EFSCORRUPTED;
896896

897-
trace_f2fs_submit_folio_bio(page_folio(page), fio);
897+
trace_f2fs_submit_folio_bio(data_folio, fio);
898898

899899
if (bio && !page_is_mergeable(fio->sbi, bio, *fio->last_block,
900900
fio->new_blkaddr))
@@ -905,16 +905,16 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio)
905905
f2fs_set_bio_crypt_ctx(bio, folio->mapping->host,
906906
folio->index, fio, GFP_NOIO);
907907

908-
add_bio_entry(fio->sbi, bio, page, fio->temp);
908+
add_bio_entry(fio->sbi, bio, &data_folio->page, fio->temp);
909909
} else {
910-
if (add_ipu_page(fio, &bio, page))
910+
if (add_ipu_page(fio, &bio, &data_folio->page))
911911
goto alloc_new;
912912
}
913913

914914
if (fio->io_wbc)
915915
wbc_account_cgroup_owner(fio->io_wbc, folio, folio_size(folio));
916916

917-
inc_page_count(fio->sbi, WB_DATA_TYPE(page, false));
917+
inc_page_count(fio->sbi, WB_DATA_TYPE(&data_folio->page, false));
918918

919919
*fio->last_block = fio->new_blkaddr;
920920
*fio->bio = bio;

0 commit comments

Comments
 (0)