mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
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>
This commit is contained in:
parent
10c6cca9c3
commit
cf62eb2c7a
@ -145,19 +145,19 @@ out_locked:
|
|||||||
void nilfs_btnode_delete(struct buffer_head *bh)
|
void nilfs_btnode_delete(struct buffer_head *bh)
|
||||||
{
|
{
|
||||||
struct address_space *mapping;
|
struct address_space *mapping;
|
||||||
struct page *page = bh->b_page;
|
struct folio *folio = bh->b_folio;
|
||||||
pgoff_t index = page_index(page);
|
pgoff_t index = folio->index;
|
||||||
int still_dirty;
|
int still_dirty;
|
||||||
|
|
||||||
get_page(page);
|
folio_get(folio);
|
||||||
lock_page(page);
|
folio_lock(folio);
|
||||||
wait_on_page_writeback(page);
|
folio_wait_writeback(folio);
|
||||||
|
|
||||||
nilfs_forget_buffer(bh);
|
nilfs_forget_buffer(bh);
|
||||||
still_dirty = PageDirty(page);
|
still_dirty = folio_test_dirty(folio);
|
||||||
mapping = page->mapping;
|
mapping = folio->mapping;
|
||||||
unlock_page(page);
|
folio_unlock(folio);
|
||||||
put_page(page);
|
folio_put(folio);
|
||||||
|
|
||||||
if (!still_dirty && mapping)
|
if (!still_dirty && mapping)
|
||||||
invalidate_inode_pages2_range(mapping, index, index);
|
invalidate_inode_pages2_range(mapping, index, index);
|
||||||
|
Loading…
Reference in New Issue
Block a user