From 86200c20a3a7885ce61c8d2ea753716c6e26bea3 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 23 Nov 2010 23:52:55 -0600 Subject: [PATCH] --- yaml --- r: 223786 b: refs/heads/master c: 086d8334cf73b3bb695b82dd864a7a8b00d96b7e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/gfs2/bmap.c | 9 +++++++-- trunk/fs/gfs2/rgrp.c | 2 +- trunk/fs/gfs2/rgrp.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7531aa33472f..c335cfed15c9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0489b3f5eba735413ccedd425651cf41d6b1f7c5 +refs/heads/master: 086d8334cf73b3bb695b82dd864a7a8b00d96b7e diff --git a/trunk/fs/gfs2/bmap.c b/trunk/fs/gfs2/bmap.c index 5476c066d4ee..ae7d205de0d1 100644 --- a/trunk/fs/gfs2/bmap.c +++ b/trunk/fs/gfs2/bmap.c @@ -780,7 +780,11 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, if (metadata) revokes = (height) ? sdp->sd_inptrs : sdp->sd_diptrs; - error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); + if (ip != GFS2_I(sdp->sd_rindex)) + error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); + else if (!sdp->sd_rgrps) + error = gfs2_ri_update(ip); + if (error) return error; @@ -879,7 +883,8 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, out_rlist: gfs2_rlist_free(&rlist); out: - gfs2_glock_dq_uninit(&ip->i_alloc->al_ri_gh); + if (ip != GFS2_I(sdp->sd_rindex)) + gfs2_glock_dq_uninit(&ip->i_alloc->al_ri_gh); return error; } diff --git a/trunk/fs/gfs2/rgrp.c b/trunk/fs/gfs2/rgrp.c index 6375b3860a9a..25dbe5c84dff 100644 --- a/trunk/fs/gfs2/rgrp.c +++ b/trunk/fs/gfs2/rgrp.c @@ -583,7 +583,7 @@ static int read_rindex_entry(struct gfs2_inode *ip, * Returns: 0 on successful update, error code otherwise */ -static int gfs2_ri_update(struct gfs2_inode *ip) +int gfs2_ri_update(struct gfs2_inode *ip) { struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); struct inode *inode = &ip->i_inode; diff --git a/trunk/fs/gfs2/rgrp.h b/trunk/fs/gfs2/rgrp.h index 0e35c0466f9a..50c2bb04369c 100644 --- a/trunk/fs/gfs2/rgrp.h +++ b/trunk/fs/gfs2/rgrp.h @@ -48,6 +48,7 @@ extern int gfs2_inplace_reserve_i(struct gfs2_inode *ip, int hold_rindex, extern void gfs2_inplace_release(struct gfs2_inode *ip); +extern int gfs2_ri_update(struct gfs2_inode *ip); extern int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n); extern int gfs2_alloc_di(struct gfs2_inode *ip, u64 *bn, u64 *generation);