Skip to content

Commit 6d8da30

Browse files
author
Andreas Gruenbacher
committed
gfs2: Turn gfs2_meta_indirect_buffer into gfs2_meta_buffer
Instead of only supporting GFS2_METATYPE_DI and GFS2_METATYPE_IN blocks, make the block type a parameter of gfs2_meta_indirect_buffer and rename the function to gfs2_meta_buffer. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 152f58c commit 6d8da30

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

fs/gfs2/bmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int __fillup_metapath(struct gfs2_inode *ip, struct metapath *mp,
331331

332332
if (!dblock)
333333
break;
334-
ret = gfs2_meta_indirect_buffer(ip, x + 1, dblock, &mp->mp_bh[x + 1]);
334+
ret = gfs2_meta_buffer(ip, GFS2_METATYPE_IN, dblock, &mp->mp_bh[x + 1]);
335335
if (ret)
336336
return ret;
337337
}

fs/gfs2/meta_io.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,23 +466,22 @@ void gfs2_journal_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
466466
}
467467

468468
/**
469-
* gfs2_meta_indirect_buffer - Get a metadata buffer
469+
* gfs2_meta_buffer - Get a metadata buffer
470470
* @ip: The GFS2 inode
471-
* @height: The level of this buf in the metadata (indir addr) tree (if any)
471+
* @mtype: The block type (GFS2_METATYPE_*)
472472
* @num: The block number (device relative) of the buffer
473473
* @bhp: the buffer is returned here
474474
*
475475
* Returns: errno
476476
*/
477477

478-
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
479-
struct buffer_head **bhp)
478+
int gfs2_meta_buffer(struct gfs2_inode *ip, u32 mtype, u64 num,
479+
struct buffer_head **bhp)
480480
{
481481
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
482482
struct gfs2_glock *gl = ip->i_gl;
483483
struct buffer_head *bh;
484484
int ret = 0;
485-
u32 mtype = height ? GFS2_METATYPE_IN : GFS2_METATYPE_DI;
486485
int rahead = 0;
487486

488487
if (num == ip->i_no_addr)

fs/gfs2/meta_io.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ enum {
6161

6262
extern void gfs2_remove_from_journal(struct buffer_head *bh, int meta);
6363
extern void gfs2_journal_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
64-
extern int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
65-
struct buffer_head **bhp);
64+
extern int gfs2_meta_buffer(struct gfs2_inode *ip, u32 mtype, u64 num,
65+
struct buffer_head **bhp);
6666

6767
static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
6868
struct buffer_head **bhp)
6969
{
70-
return gfs2_meta_indirect_buffer(ip, 0, ip->i_no_addr, bhp);
70+
return gfs2_meta_buffer(ip, GFS2_METATYPE_DI, ip->i_no_addr, bhp);
7171
}
7272

7373
struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen);

0 commit comments

Comments
 (0)