aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/xattr.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-08-31 11:38:29 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2011-10-21 07:39:33 -0400
commit8339ee543ece6e2dcc1bbd97d5350163c198cf00 (patch)
tree80b3d4b990a8ab5f8b7c28945f694b01301c05c6 /fs/gfs2/xattr.c
parent7c9ca621137cde26be05448133fc1a554345f4f8 (diff)
GFS2: Make resource groups "append only" during life of fs
Since we have ruled out supporting online filesystem shrink, it is possible to make the resource group list append only during the life of a super block. This gives several benefits: Firstly, we only need to read new rindex elements as they are added rather than needing to reread the whole rindex file each time one element is added. Secondly, the rindex glock can be held for much shorter periods of time, and is completely removed from the fast path for allocations. The lock is taken in shared mode only when updating the resource groups when the first allocation occurs, and after a grow has taken place. Thirdly, this results in a reduction in code size, and everything gets a lot simpler to understand in this area. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/xattr.c')
-rw-r--r--fs/gfs2/xattr.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c
index 695304cf01cc..167f4af53b1d 100644
--- a/fs/gfs2/xattr.c
+++ b/fs/gfs2/xattr.c
@@ -332,15 +332,8 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
332 if (error) 332 if (error)
333 goto out_alloc; 333 goto out_alloc;
334 334
335 error = gfs2_rindex_hold(GFS2_SB(&ip->i_inode), &al->al_ri_gh);
336 if (error)
337 goto out_quota;
338
339 error = ea_dealloc_unstuffed(ip, bh, ea, prev, (leave) ? &error : NULL); 335 error = ea_dealloc_unstuffed(ip, bh, ea, prev, (leave) ? &error : NULL);
340 336
341 gfs2_glock_dq_uninit(&al->al_ri_gh);
342
343out_quota:
344 gfs2_quota_unhold(ip); 337 gfs2_quota_unhold(ip);
345out_alloc: 338out_alloc:
346 gfs2_alloc_put(ip); 339 gfs2_alloc_put(ip);
@@ -1502,24 +1495,18 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
1502 if (error) 1495 if (error)
1503 goto out_alloc; 1496 goto out_alloc;
1504 1497
1505 error = gfs2_rindex_hold(GFS2_SB(&ip->i_inode), &al->al_ri_gh);
1506 if (error)
1507 goto out_quota;
1508
1509 error = ea_foreach(ip, ea_dealloc_unstuffed, NULL); 1498 error = ea_foreach(ip, ea_dealloc_unstuffed, NULL);
1510 if (error) 1499 if (error)
1511 goto out_rindex; 1500 goto out_quota;
1512 1501
1513 if (ip->i_diskflags & GFS2_DIF_EA_INDIRECT) { 1502 if (ip->i_diskflags & GFS2_DIF_EA_INDIRECT) {
1514 error = ea_dealloc_indirect(ip); 1503 error = ea_dealloc_indirect(ip);
1515 if (error) 1504 if (error)
1516 goto out_rindex; 1505 goto out_quota;
1517 } 1506 }
1518 1507
1519 error = ea_dealloc_block(ip); 1508 error = ea_dealloc_block(ip);
1520 1509
1521out_rindex:
1522 gfs2_glock_dq_uninit(&al->al_ri_gh);
1523out_quota: 1510out_quota:
1524 gfs2_quota_unhold(ip); 1511 gfs2_quota_unhold(ip);
1525out_alloc: 1512out_alloc: