Skip to content

Commit f2f9c81

Browse files
AstralBobswhiteho
authored andcommitted
GFS2: Eliminate unused "new" parameter to gfs2_meta_indirect_buffer
It turns out that the "new" parameter to function gfs2_meta_indirect_buffer was always being passed in as zero. Therefore, this patch eliminates it and simplifies the function. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 2ebc3f8 commit f2f9c81

3 files changed

Lines changed: 10 additions & 19 deletions

File tree

‎fs/gfs2/bmap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int lookup_metapath(struct gfs2_inode *ip, struct metapath *mp)
324324
if (!dblock)
325325
return x + 1;
326326

327-
ret = gfs2_meta_indirect_buffer(ip, x+1, dblock, 0, &mp->mp_bh[x+1]);
327+
ret = gfs2_meta_indirect_buffer(ip, x+1, dblock, &mp->mp_bh[x+1]);
328328
if (ret)
329329
return ret;
330330
}
@@ -882,7 +882,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
882882
top = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0];
883883
bottom = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs;
884884
} else {
885-
error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh);
885+
error = gfs2_meta_indirect_buffer(ip, height, block, &bh);
886886
if (error)
887887
return error;
888888

‎fs/gfs2/meta_io.c‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,33 +374,24 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
374374
* @ip: The GFS2 inode
375375
* @height: The level of this buf in the metadata (indir addr) tree (if any)
376376
* @num: The block number (device relative) of the buffer
377-
* @new: Non-zero if we may create a new buffer
378377
* @bhp: the buffer is returned here
379378
*
380379
* Returns: errno
381380
*/
382381

383382
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
384-
int new, struct buffer_head **bhp)
383+
struct buffer_head **bhp)
385384
{
386385
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
387386
struct gfs2_glock *gl = ip->i_gl;
388387
struct buffer_head *bh;
389388
int ret = 0;
389+
u32 mtype = height ? GFS2_METATYPE_IN : GFS2_METATYPE_DI;
390390

391-
if (new) {
392-
BUG_ON(height == 0);
393-
bh = gfs2_meta_new(gl, num);
394-
gfs2_trans_add_bh(ip->i_gl, bh, 1);
395-
gfs2_metatype_set(bh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
396-
gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
397-
} else {
398-
u32 mtype = height ? GFS2_METATYPE_IN : GFS2_METATYPE_DI;
399-
ret = gfs2_meta_read(gl, num, DIO_WAIT, &bh);
400-
if (ret == 0 && gfs2_metatype_check(sdp, bh, mtype)) {
401-
brelse(bh);
402-
ret = -EIO;
403-
}
391+
ret = gfs2_meta_read(gl, num, DIO_WAIT, &bh);
392+
if (ret == 0 && gfs2_metatype_check(sdp, bh, mtype)) {
393+
brelse(bh);
394+
ret = -EIO;
404395
}
405396
*bhp = bh;
406397
return ret;

‎fs/gfs2/meta_io.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr,
6565
void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
6666

6767
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
68-
int new, struct buffer_head **bhp);
68+
struct buffer_head **bhp);
6969

7070
static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
7171
struct buffer_head **bhp)
7272
{
73-
return gfs2_meta_indirect_buffer(ip, 0, ip->i_no_addr, 0, bhp);
73+
return gfs2_meta_indirect_buffer(ip, 0, ip->i_no_addr, bhp);
7474
}
7575

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

0 commit comments

Comments
 (0)