nilfs2: replace obvious uses of b_page with b_folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 15 Dec 2022 21:44:00 +0000 (21:44 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 19 Jan 2023 01:12:41 +0000 (17:12 -0800)
These places just use b_page to get to the buffer's address_space or the
index of the page the buffer is in.

Link: https://lkml.kernel.org/r/20221215214402.3522366-11-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/btnode.c
fs/nilfs2/btree.c
fs/nilfs2/gcinode.c
fs/nilfs2/mdt.c
fs/nilfs2/segment.c

index e74fda2..e956f88 100644 (file)
@@ -188,7 +188,7 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
                struct page *opage = obh->b_page;
                lock_page(opage);
 retry:
-               /* BUG_ON(oldkey != obh->b_page->index); */
+               /* BUG_ON(oldkey != obh->b_folio->index); */
                if (unlikely(oldkey != opage->index))
                        NILFS_PAGE_BUG(opage,
                                       "invalid oldkey %lld (newkey=%lld)",
index 40ce92a..b5f997e 100644 (file)
@@ -398,7 +398,7 @@ int nilfs_btree_broken_node_block(struct buffer_head *bh)
        if (buffer_nilfs_checked(bh))
                return 0;
 
-       inode = bh->b_page->mapping->host;
+       inode = bh->b_folio->mapping->host;
        ret = nilfs_btree_node_broken((struct nilfs_btree_node *)bh->b_data,
                                      bh->b_size, inode, bh->b_blocknr);
        if (likely(!ret))
index b0d22ff..48fe71d 100644 (file)
@@ -140,7 +140,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
 {
        wait_on_buffer(bh);
        if (!buffer_uptodate(bh)) {
-               struct inode *inode = bh->b_page->mapping->host;
+               struct inode *inode = bh->b_folio->mapping->host;
 
                nilfs_err(inode->i_sb,
                          "I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)",
index cbf4fa6..19c8158 100644 (file)
@@ -563,7 +563,7 @@ int nilfs_mdt_freeze_buffer(struct inode *inode, struct buffer_head *bh)
        struct page *page;
        int blkbits = inode->i_blkbits;
 
-       page = grab_cache_page(shadow->inode->i_mapping, bh->b_page->index);
+       page = grab_cache_page(shadow->inode->i_mapping, bh->b_folio->index);
        if (!page)
                return -ENOMEM;
 
@@ -595,7 +595,7 @@ nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh)
        struct page *page;
        int n;
 
-       page = find_lock_page(shadow->inode->i_mapping, bh->b_page->index);
+       page = find_lock_page(shadow->inode->i_mapping, bh->b_folio->index);
        if (page) {
                if (page_has_buffers(page)) {
                        n = bh_offset(bh) >> inode->i_blkbits;
index 76c3bd8..f7a14ed 100644 (file)
@@ -1581,7 +1581,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
                        nblocks = le32_to_cpu(finfo->fi_nblocks);
                        ndatablk = le32_to_cpu(finfo->fi_ndatablk);
 
-                       inode = bh->b_page->mapping->host;
+                       inode = bh->b_folio->mapping->host;
 
                        if (mode == SC_LSEG_DSYNC)
                                sc_op = &nilfs_sc_dsync_ops;