Commit 6ad4cd7f authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

nilfs2: replace obvious uses of b_page with b_folio

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.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0d22fe2f
...@@ -188,7 +188,7 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc, ...@@ -188,7 +188,7 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
struct page *opage = obh->b_page; struct page *opage = obh->b_page;
lock_page(opage); lock_page(opage);
retry: retry:
/* BUG_ON(oldkey != obh->b_page->index); */ /* BUG_ON(oldkey != obh->b_folio->index); */
if (unlikely(oldkey != opage->index)) if (unlikely(oldkey != opage->index))
NILFS_PAGE_BUG(opage, NILFS_PAGE_BUG(opage,
"invalid oldkey %lld (newkey=%lld)", "invalid oldkey %lld (newkey=%lld)",
......
...@@ -398,7 +398,7 @@ int nilfs_btree_broken_node_block(struct buffer_head *bh) ...@@ -398,7 +398,7 @@ int nilfs_btree_broken_node_block(struct buffer_head *bh)
if (buffer_nilfs_checked(bh)) if (buffer_nilfs_checked(bh))
return 0; 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, ret = nilfs_btree_node_broken((struct nilfs_btree_node *)bh->b_data,
bh->b_size, inode, bh->b_blocknr); bh->b_size, inode, bh->b_blocknr);
if (likely(!ret)) if (likely(!ret))
......
...@@ -140,7 +140,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh) ...@@ -140,7 +140,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
{ {
wait_on_buffer(bh); wait_on_buffer(bh);
if (!buffer_uptodate(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, nilfs_err(inode->i_sb,
"I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)", "I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)",
......
...@@ -563,7 +563,7 @@ int nilfs_mdt_freeze_buffer(struct inode *inode, struct buffer_head *bh) ...@@ -563,7 +563,7 @@ int nilfs_mdt_freeze_buffer(struct inode *inode, struct buffer_head *bh)
struct page *page; struct page *page;
int blkbits = inode->i_blkbits; 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) if (!page)
return -ENOMEM; return -ENOMEM;
...@@ -595,7 +595,7 @@ nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh) ...@@ -595,7 +595,7 @@ nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh)
struct page *page; struct page *page;
int n; 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) {
if (page_has_buffers(page)) { if (page_has_buffers(page)) {
n = bh_offset(bh) >> inode->i_blkbits; n = bh_offset(bh) >> inode->i_blkbits;
......
...@@ -1581,7 +1581,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci, ...@@ -1581,7 +1581,7 @@ nilfs_segctor_update_payload_blocknr(struct nilfs_sc_info *sci,
nblocks = le32_to_cpu(finfo->fi_nblocks); nblocks = le32_to_cpu(finfo->fi_nblocks);
ndatablk = le32_to_cpu(finfo->fi_ndatablk); ndatablk = le32_to_cpu(finfo->fi_ndatablk);
inode = bh->b_page->mapping->host; inode = bh->b_folio->mapping->host;
if (mode == SC_LSEG_DSYNC) if (mode == SC_LSEG_DSYNC)
sc_op = &nilfs_sc_dsync_ops; sc_op = &nilfs_sc_dsync_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment