aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/xattr.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-05-18 09:28:23 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-06-06 06:20:22 -0400
commit5407e24229408d7586ee451a384fc13e4a2332be (patch)
tree7534b0d0fc69de50b6156ec4e384a71acf01dea1 /fs/gfs2/xattr.c
parent0a305e496059a113f93bdd3ad27a5aaa917fe34d (diff)
GFS2: Fold quota data into the reservations struct
This patch moves the ancillary quota data structures into the block reservations structure. This saves GFS2 some time and effort in allocating and deallocating the qadata structure. 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.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c
index 927f4df874ae..523c0de0d805 100644
--- a/fs/gfs2/xattr.c
+++ b/fs/gfs2/xattr.c
@@ -325,13 +325,8 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
325 struct gfs2_ea_header *ea, 325 struct gfs2_ea_header *ea,
326 struct gfs2_ea_header *prev, int leave) 326 struct gfs2_ea_header *prev, int leave)
327{ 327{
328 struct gfs2_qadata *qa;
329 int error; 328 int error;
330 329
331 qa = gfs2_qadata_get(ip);
332 if (!qa)
333 return -ENOMEM;
334
335 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 330 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
336 if (error) 331 if (error)
337 goto out_alloc; 332 goto out_alloc;
@@ -340,7 +335,6 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
340 335
341 gfs2_quota_unhold(ip); 336 gfs2_quota_unhold(ip);
342out_alloc: 337out_alloc:
343 gfs2_qadata_put(ip);
344 return error; 338 return error;
345} 339}
346 340
@@ -713,17 +707,12 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
713 unsigned int blks, 707 unsigned int blks,
714 ea_skeleton_call_t skeleton_call, void *private) 708 ea_skeleton_call_t skeleton_call, void *private)
715{ 709{
716 struct gfs2_qadata *qa;
717 struct buffer_head *dibh; 710 struct buffer_head *dibh;
718 int error; 711 int error;
719 712
720 qa = gfs2_qadata_get(ip);
721 if (!qa)
722 return -ENOMEM;
723
724 error = gfs2_quota_lock_check(ip); 713 error = gfs2_quota_lock_check(ip);
725 if (error) 714 if (error)
726 goto out; 715 return error;
727 716
728 error = gfs2_inplace_reserve(ip, blks); 717 error = gfs2_inplace_reserve(ip, blks);
729 if (error) 718 if (error)
@@ -753,8 +742,6 @@ out_ipres:
753 gfs2_inplace_release(ip); 742 gfs2_inplace_release(ip);
754out_gunlock_q: 743out_gunlock_q:
755 gfs2_quota_unlock(ip); 744 gfs2_quota_unlock(ip);
756out:
757 gfs2_qadata_put(ip);
758 return error; 745 return error;
759} 746}
760 747
@@ -1494,16 +1481,11 @@ out_gunlock:
1494 1481
1495int gfs2_ea_dealloc(struct gfs2_inode *ip) 1482int gfs2_ea_dealloc(struct gfs2_inode *ip)
1496{ 1483{
1497 struct gfs2_qadata *qa;
1498 int error; 1484 int error;
1499 1485
1500 qa = gfs2_qadata_get(ip);
1501 if (!qa)
1502 return -ENOMEM;
1503
1504 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 1486 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
1505 if (error) 1487 if (error)
1506 goto out_alloc; 1488 return error;
1507 1489
1508 error = ea_foreach(ip, ea_dealloc_unstuffed, NULL); 1490 error = ea_foreach(ip, ea_dealloc_unstuffed, NULL);
1509 if (error) 1491 if (error)
@@ -1519,8 +1501,6 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
1519 1501
1520out_quota: 1502out_quota:
1521 gfs2_quota_unhold(ip); 1503 gfs2_quota_unhold(ip);
1522out_alloc:
1523 gfs2_qadata_put(ip);
1524 return error; 1504 return error;
1525} 1505}
1526 1506