diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-11-14 17:44:33 +0900 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-10 17:21:30 -0800 |
commit | cf62eb2c7a74aae8ef5bee000cf4ac1f77af6fad (patch) | |
tree | 0b54ac4ec3393b28bb37ba9f629c01a266310fe5 /fs/nilfs2 | |
parent | 10c6cca9c3233d6328eb192821a647dc8fdffd0e (diff) | |
download | lwn-cf62eb2c7a74aae8ef5bee000cf4ac1f77af6fad.tar.gz lwn-cf62eb2c7a74aae8ef5bee000cf4ac1f77af6fad.zip |
nilfs2: convert nilfs_btnode_delete to use a folio
Saves six calls to compound_head().
Link: https://lkml.kernel.org/r/20231114084436.2755-18-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/btnode.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 5ef9eebd8d2e..e077d4a7a11c 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c @@ -145,19 +145,19 @@ out_locked: void nilfs_btnode_delete(struct buffer_head *bh) { struct address_space *mapping; - struct page *page = bh->b_page; - pgoff_t index = page_index(page); + struct folio *folio = bh->b_folio; + pgoff_t index = folio->index; int still_dirty; - get_page(page); - lock_page(page); - wait_on_page_writeback(page); + folio_get(folio); + folio_lock(folio); + folio_wait_writeback(folio); nilfs_forget_buffer(bh); - still_dirty = PageDirty(page); - mapping = page->mapping; - unlock_page(page); - put_page(page); + still_dirty = folio_test_dirty(folio); + mapping = folio->mapping; + folio_unlock(folio); + folio_put(folio); if (!still_dirty && mapping) invalidate_inode_pages2_range(mapping, index, index); |