aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2012-02-24 10:09:14 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2012-02-28 04:52:39 -0500
commita365fbf354907430e6852f0c373b4b3eeff81ba3 (patch)
tree65d5ed095e3150d6061860f5aefd150a5ab76cfd /fs/gfs2/inode.c
parent9e73f571ea3afffca78c1f54128d57796e27532f (diff)
GFS2: Read resource groups on mount
This makes mount take slightly longer, but at the same time, the first write to the filesystem will be faster too. It also means that if there is a problem in the resource index, then we can refuse to mount rather than having to try and report that when the first write occurs. In addition, to avoid recursive locking, we hvae to take account of instances when the rindex glock may already be held when we are trying to update the rbtree of resource groups. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c87faf48f0a1..56987460cdae 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -391,10 +391,6 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation)
391 int error; 391 int error;
392 int dblocks = 1; 392 int dblocks = 1;
393 393
394 error = gfs2_rindex_update(sdp);
395 if (error)
396 fs_warn(sdp, "rindex update returns %d\n", error);
397
398 error = gfs2_inplace_reserve(dip, RES_DINODE); 394 error = gfs2_inplace_reserve(dip, RES_DINODE);
399 if (error) 395 if (error)
400 goto out; 396 goto out;
@@ -1035,19 +1031,15 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
1035 struct buffer_head *bh; 1031 struct buffer_head *bh;
1036 struct gfs2_holder ghs[3]; 1032 struct gfs2_holder ghs[3];
1037 struct gfs2_rgrpd *rgd; 1033 struct gfs2_rgrpd *rgd;
1038 int error; 1034 int error = -EROFS;
1039 1035
1040 error = gfs2_rindex_update(sdp);
1041 if (error)
1042 return error;
1043 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); 1036 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
1044 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1); 1037 gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1);
1045 1038
1046 rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); 1039 rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr);
1047 if (!rgd) { 1040 if (!rgd)
1048 error = -EROFS;
1049 goto out_inodes; 1041 goto out_inodes;
1050 } 1042
1051 gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); 1043 gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2);
1052 1044
1053 1045