summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/page.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-10-16 21:10:52 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-10-25 16:47:08 -0700
commit0217fbb0271a7c78e16629cf45375916ec2eb35f (patch)
tree697f73761ea580fc613ad7e46a6cd0d475f9c060 /fs/nilfs2/page.h
parentd4059993674b533798a551859042957bb5578332 (diff)
downloadlinux-0217fbb0271a7c78e16629cf45375916ec2eb35f.tar.gz
linux-0217fbb0271a7c78e16629cf45375916ec2eb35f.tar.bz2
linux-0217fbb0271a7c78e16629cf45375916ec2eb35f.zip
buffer: add get_nth_bh()
Extract this useful helper from nilfs_page_get_nth_block() Link: https://lkml.kernel.org/r/20231016201114.1928083-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Cc: Andreas Gruenbacher <agruenba@redhat.com> Cc: Pankaj Raghav <p.raghav@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/page.h')
-rw-r--r--fs/nilfs2/page.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h
index 21ddcdd4d63e..344d71942d36 100644
--- a/fs/nilfs2/page.h
+++ b/fs/nilfs2/page.h
@@ -55,12 +55,7 @@ unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
static inline struct buffer_head *
nilfs_page_get_nth_block(struct page *page, unsigned int count)
{
- struct buffer_head *bh = page_buffers(page);
-
- while (count-- > 0)
- bh = bh->b_this_page;
- get_bh(bh);
- return bh;
+ return get_nth_bh(page_buffers(page), count);
}
#endif /* _NILFS_PAGE_H */