Commit 797e25ad authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

nilfs2: convert nilfs_forget_buffer to use a folio

Save two hidden calls to compound_head().

Link: https://lkml.kernel.org/r/20231114084436.2755-5-konishi.ryusuke@gmail.comSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 3cd36212
...@@ -73,7 +73,7 @@ struct buffer_head *nilfs_grab_buffer(struct inode *inode, ...@@ -73,7 +73,7 @@ struct buffer_head *nilfs_grab_buffer(struct inode *inode,
*/ */
void nilfs_forget_buffer(struct buffer_head *bh) void nilfs_forget_buffer(struct buffer_head *bh)
{ {
struct page *page = bh->b_page; struct folio *folio = bh->b_folio;
const unsigned long clear_bits = const unsigned long clear_bits =
(BIT(BH_Uptodate) | BIT(BH_Dirty) | BIT(BH_Mapped) | (BIT(BH_Uptodate) | BIT(BH_Dirty) | BIT(BH_Mapped) |
BIT(BH_Async_Write) | BIT(BH_NILFS_Volatile) | BIT(BH_Async_Write) | BIT(BH_NILFS_Volatile) |
...@@ -81,12 +81,12 @@ void nilfs_forget_buffer(struct buffer_head *bh) ...@@ -81,12 +81,12 @@ void nilfs_forget_buffer(struct buffer_head *bh)
lock_buffer(bh); lock_buffer(bh);
set_mask_bits(&bh->b_state, clear_bits, 0); set_mask_bits(&bh->b_state, clear_bits, 0);
if (nilfs_page_buffers_clean(page)) if (nilfs_page_buffers_clean(&folio->page))
__nilfs_clear_page_dirty(page); __nilfs_clear_page_dirty(&folio->page);
bh->b_blocknr = -1; bh->b_blocknr = -1;
ClearPageUptodate(page); folio_clear_uptodate(folio);
ClearPageMappedToDisk(page); folio_clear_mappedtodisk(folio);
unlock_buffer(bh); unlock_buffer(bh);
brelse(bh); brelse(bh);
} }
......
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