aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/xattr.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-07-19 08:12:40 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-07-19 09:51:08 -0400
commit8e2e00473598dd5379d8408cb974dade000acafc (patch)
tree1f7bfdf0d07b6c0315bbd11ffee174742d66a459 /fs/gfs2/xattr.c
parent294f2ad5a545eb71d397623743ddd8201131bdad (diff)
GFS2: Reduce file fragmentation
This patch reduces GFS2 file fragmentation by pre-reserving blocks. The resulting improved on disk layout greatly speeds up operations in cases which would have resulted in interlaced allocation of blocks previously. A typical example of this is 10 parallel dd processes, each writing to a file in a common dirctory. The implementation uses an rbtree of reservations attached to each resource group (and each inode). Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/xattr.c')
-rw-r--r--fs/gfs2/xattr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c
index 523c0de0d805..27a0b4a901f5 100644
--- a/fs/gfs2/xattr.c
+++ b/fs/gfs2/xattr.c
@@ -327,6 +327,10 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
327{ 327{
328 int error; 328 int error;
329 329
330 error = gfs2_rindex_update(GFS2_SB(&ip->i_inode));
331 if (error)
332 return error;
333
330 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 334 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
331 if (error) 335 if (error)
332 goto out_alloc; 336 goto out_alloc;
@@ -710,6 +714,10 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
710 struct buffer_head *dibh; 714 struct buffer_head *dibh;
711 int error; 715 int error;
712 716
717 error = gfs2_rindex_update(GFS2_SB(&ip->i_inode));
718 if (error)
719 return error;
720
713 error = gfs2_quota_lock_check(ip); 721 error = gfs2_quota_lock_check(ip);
714 if (error) 722 if (error)
715 return error; 723 return error;
@@ -1483,6 +1491,10 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
1483{ 1491{
1484 int error; 1492 int error;
1485 1493
1494 error = gfs2_rindex_update(GFS2_SB(&ip->i_inode));
1495 if (error)
1496 return error;
1497
1486 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 1498 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
1487 if (error) 1499 if (error)
1488 return error; 1500 return error;