diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-11-28 05:58:19 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-12-16 17:12:04 +0100 |
commit | ac866908d7a92b6b2be1127a2d5e85e23da86fa3 (patch) | |
tree | be641a61f4ff32a32325d486d7072ad318b4ee4a | |
parent | f2fs: Use a folio in f2fs_truncate_partial_cluster() (diff) | |
download | linux-ac866908d7a92b6b2be1127a2d5e85e23da86fa3.tar.xz linux-ac866908d7a92b6b2be1127a2d5e85e23da86fa3.zip |
f2fs: Use a folio in f2fs_write_compressed_pages()
Remove accesses to page->index and an unnecessary reference to
page->mapping.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/compress.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 494baa1e8bd3..0b55b2695c9b 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1282,6 +1282,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, .encrypted = fscrypt_inode_uses_fs_layer_crypto(cc->inode) ? 1 : 0, }; + struct folio *folio; struct dnode_of_data dn; struct node_info ni; struct compress_io_ctx *cic; @@ -1293,7 +1294,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, /* we should bypass data pages to proceed the kworker jobs */ if (unlikely(f2fs_cp_error(sbi))) { - mapping_set_error(cc->rpages[0]->mapping, -EIO); + mapping_set_error(inode->i_mapping, -EIO); goto out_free; } @@ -1320,7 +1321,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, goto out_put_dnode; } - psize = (loff_t)(cc->rpages[last_index]->index + 1) << PAGE_SHIFT; + folio = page_folio(cc->rpages[last_index]); + psize = folio_pos(folio) + folio_size(folio); err = f2fs_get_node_info(fio.sbi, dn.nid, &ni, false); if (err) @@ -1343,7 +1345,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, for (i = 0; i < cc->valid_nr_cpages; i++) { f2fs_set_compressed_page(cc->cpages[i], inode, - cc->rpages[i + 1]->index, cic); + page_folio(cc->rpages[i + 1])->index, cic); fio.compressed_page = cc->cpages[i]; fio.old_blkaddr = data_blkaddr(dn.inode, dn.node_page, |