]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
gfs2: Add metapath_dibh helper
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 19 Oct 2023 23:32:15 +0000 (01:32 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 2 Nov 2023 19:10:00 +0000 (20:10 +0100)
Add a metapath_dibh() helper for extracting the inode's buffer head from
a metapath.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/bmap.c

index 47d0f39feeb1fde8fd791aafffe4fee921934718..240f73e402d028528fa6b350743d59987fff558c 100644 (file)
@@ -317,6 +317,12 @@ static void gfs2_metapath_ra(struct gfs2_glock *gl, __be64 *start, __be64 *end)
        }
 }
 
+static inline struct buffer_head *
+metapath_dibh(struct metapath *mp)
+{
+       return mp->mp_bh[0];
+}
+
 static int __fillup_metapath(struct gfs2_inode *ip, struct metapath *mp,
                             unsigned int x, unsigned int h)
 {
@@ -659,7 +665,7 @@ static int __gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap,
 {
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
-       struct buffer_head *dibh = mp->mp_bh[0];
+       struct buffer_head *dibh = metapath_dibh(mp);
        u64 bn;
        unsigned n, i, blks, alloced = 0, iblks = 0, branch_start = 0;
        size_t dblks = iomap->length >> inode->i_blkbits;