ocfs2: convert ocfs2_write_failure() to use a folio
authorMark Tinguely <mark.tinguely@oracle.com>
Thu, 5 Dec 2024 17:16:38 +0000 (17:16 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 13 Jan 2025 04:21:11 +0000 (20:21 -0800)
Remove the folio->page conversion and just use the folio.

Link: https://lkml.kernel.org/r/20241205171653.3179945-11-willy@infradead.org
Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/aops.c

index f088183fbae221c6acb8ba6fd3ea5104038551bd..2b3a3f5566d5eec82c470e8aaef2817aaab52f22 100644 (file)
@@ -930,20 +930,19 @@ static void ocfs2_write_failure(struct inode *inode,
        int i;
        unsigned from = user_pos & (PAGE_SIZE - 1),
                to = user_pos + user_len;
-       struct page *tmppage;
 
        if (wc->w_target_folio)
                ocfs2_zero_new_buffers(wc->w_target_folio, from, to);
 
        for (i = 0; i < wc->w_num_folios; i++) {
-               tmppage = &wc->w_folios[i]->page;
+               struct folio *folio = wc->w_folios[i];
 
-               if (tmppage && page_has_buffers(tmppage)) {
+               if (folio && folio_buffers(folio)) {
                        if (ocfs2_should_order_data(inode))
                                ocfs2_jbd2_inode_add_write(wc->w_handle, inode,
                                                           user_pos, user_len);
 
-                       block_commit_write(tmppage, from, to);
+                       block_commit_write(&folio->page, from, to);
                }
        }
 }