aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-05-10 08:33:55 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-05-11 05:19:23 -0400
commitf2f9c8124482fa2e189d0ee321aac7a2cc76a57a (patch)
tree1aa7b52bc76184b495065a462978553a80af6208
parent2ebc3f8b3ecf66ddf31285aad1b5db4245c2c04a (diff)
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>
-rw-r--r--fs/gfs2/bmap.c4
-rw-r--r--fs/gfs2/meta_io.c21
-rw-r--r--fs/gfs2/meta_io.h4
3 files changed, 10 insertions, 19 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 420bbeb86147..dab54099dd98 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -324,7 +324,7 @@ static int lookup_metapath(struct gfs2_inode *ip, struct metapath *mp)
324 if (!dblock) 324 if (!dblock)
325 return x + 1; 325 return x + 1;
326 326
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]);
328 if (ret) 328 if (ret)
329 return ret; 329 return ret;
330 } 330 }
@@ -882,7 +882,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
882 top = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0]; 882 top = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + mp->mp_list[0];
883 bottom = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs; 883 bottom = (__be64 *)(bh->b_data + sizeof(struct gfs2_dinode)) + sdp->sd_diptrs;
884 } else { 884 } else {
885 error = gfs2_meta_indirect_buffer(ip, height, block, 0, &bh); 885 error = gfs2_meta_indirect_buffer(ip, height, block, &bh);
886 if (error) 886 if (error)
887 return error; 887 return error;
888 888
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 7f69ae2595f0..6c1e5d1c404a 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -374,33 +374,24 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
374 * @ip: The GFS2 inode 374 * @ip: The GFS2 inode
375 * @height: The level of this buf in the metadata (indir addr) tree (if any) 375 * @height: The level of this buf in the metadata (indir addr) tree (if any)
376 * @num: The block number (device relative) of the buffer 376 * @num: The block number (device relative) of the buffer
377 * @new: Non-zero if we may create a new buffer
378 * @bhp: the buffer is returned here 377 * @bhp: the buffer is returned here
379 * 378 *
380 * Returns: errno 379 * Returns: errno
381 */ 380 */
382 381
383int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num, 382int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
384 int new, struct buffer_head **bhp) 383 struct buffer_head **bhp)
385{ 384{
386 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 385 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
387 struct gfs2_glock *gl = ip->i_gl; 386 struct gfs2_glock *gl = ip->i_gl;
388 struct buffer_head *bh; 387 struct buffer_head *bh;
389 int ret = 0; 388 int ret = 0;
389 u32 mtype = height ? GFS2_METATYPE_IN : GFS2_METATYPE_DI;
390 390
391 if (new) { 391 ret = gfs2_meta_read(gl, num, DIO_WAIT, &bh);
392 BUG_ON(height == 0); 392 if (ret == 0 && gfs2_metatype_check(sdp, bh, mtype)) {
393 bh = gfs2_meta_new(gl, num); 393 brelse(bh);
394 gfs2_trans_add_bh(ip->i_gl, bh, 1); 394 ret = -EIO;
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 }
404 } 395 }
405 *bhp = bh; 396 *bhp = bh;
406 return ret; 397 return ret;
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index 22c526593131..c30973b07a7c 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -65,12 +65,12 @@ void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr,
65void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen); 65void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
66 66
67int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num, 67int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
68 int new, struct buffer_head **bhp); 68 struct buffer_head **bhp);
69 69
70static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip, 70static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
71 struct buffer_head **bhp) 71 struct buffer_head **bhp)
72{ 72{
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);
74} 74}
75 75
76struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen); 76struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen);