diff options
Diffstat (limited to 'fs/gfs2/xattr.c')
-rw-r--r-- | fs/gfs2/xattr.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 927f4df874ae..27a0b4a901f5 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -325,12 +325,11 @@ 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); | 330 | error = gfs2_rindex_update(GFS2_SB(&ip->i_inode)); |
332 | if (!qa) | 331 | if (error) |
333 | return -ENOMEM; | 332 | return error; |
334 | 333 | ||
335 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 334 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); |
336 | if (error) | 335 | if (error) |
@@ -340,7 +339,6 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
340 | 339 | ||
341 | gfs2_quota_unhold(ip); | 340 | gfs2_quota_unhold(ip); |
342 | out_alloc: | 341 | out_alloc: |
343 | gfs2_qadata_put(ip); | ||
344 | return error; | 342 | return error; |
345 | } | 343 | } |
346 | 344 | ||
@@ -713,17 +711,16 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
713 | unsigned int blks, | 711 | unsigned int blks, |
714 | ea_skeleton_call_t skeleton_call, void *private) | 712 | ea_skeleton_call_t skeleton_call, void *private) |
715 | { | 713 | { |
716 | struct gfs2_qadata *qa; | ||
717 | struct buffer_head *dibh; | 714 | struct buffer_head *dibh; |
718 | int error; | 715 | int error; |
719 | 716 | ||
720 | qa = gfs2_qadata_get(ip); | 717 | error = gfs2_rindex_update(GFS2_SB(&ip->i_inode)); |
721 | if (!qa) | 718 | if (error) |
722 | return -ENOMEM; | 719 | return error; |
723 | 720 | ||
724 | error = gfs2_quota_lock_check(ip); | 721 | error = gfs2_quota_lock_check(ip); |
725 | if (error) | 722 | if (error) |
726 | goto out; | 723 | return error; |
727 | 724 | ||
728 | error = gfs2_inplace_reserve(ip, blks); | 725 | error = gfs2_inplace_reserve(ip, blks); |
729 | if (error) | 726 | if (error) |
@@ -753,8 +750,6 @@ out_ipres: | |||
753 | gfs2_inplace_release(ip); | 750 | gfs2_inplace_release(ip); |
754 | out_gunlock_q: | 751 | out_gunlock_q: |
755 | gfs2_quota_unlock(ip); | 752 | gfs2_quota_unlock(ip); |
756 | out: | ||
757 | gfs2_qadata_put(ip); | ||
758 | return error; | 753 | return error; |
759 | } | 754 | } |
760 | 755 | ||
@@ -1494,16 +1489,15 @@ out_gunlock: | |||
1494 | 1489 | ||
1495 | int gfs2_ea_dealloc(struct gfs2_inode *ip) | 1490 | int gfs2_ea_dealloc(struct gfs2_inode *ip) |
1496 | { | 1491 | { |
1497 | struct gfs2_qadata *qa; | ||
1498 | int error; | 1492 | int error; |
1499 | 1493 | ||
1500 | qa = gfs2_qadata_get(ip); | 1494 | error = gfs2_rindex_update(GFS2_SB(&ip->i_inode)); |
1501 | if (!qa) | 1495 | if (error) |
1502 | return -ENOMEM; | 1496 | return error; |
1503 | 1497 | ||
1504 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1498 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); |
1505 | if (error) | 1499 | if (error) |
1506 | goto out_alloc; | 1500 | return error; |
1507 | 1501 | ||
1508 | error = ea_foreach(ip, ea_dealloc_unstuffed, NULL); | 1502 | error = ea_foreach(ip, ea_dealloc_unstuffed, NULL); |
1509 | if (error) | 1503 | if (error) |
@@ -1519,8 +1513,6 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip) | |||
1519 | 1513 | ||
1520 | out_quota: | 1514 | out_quota: |
1521 | gfs2_quota_unhold(ip); | 1515 | gfs2_quota_unhold(ip); |
1522 | out_alloc: | ||
1523 | gfs2_qadata_put(ip); | ||
1524 | return error; | 1516 | return error; |
1525 | } | 1517 | } |
1526 | 1518 | ||