aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2010-06-24 19:21:20 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2010-07-29 04:36:56 -0400
commit461cb419f074aab16836a660efb8e855b6c1609c (patch)
tree0b4ca5ab5c01efc37505a43ad96dbc94ae2bb95b /fs/gfs2/quota.c
parentba6e93645f039bd357e04b7b9d18f4e67757725e (diff)
GFS2: Simplify gfs2_write_alloc_required
Function gfs2_write_alloc_required always returned zero as its return code. Therefore, it doesn't need to return a return code at all. Given that, we can use the return value to return whether or not the dinode needs block allocations rather than passing that value in, which in turn simplifies a bunch of error checking. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 8f02d3db8f42..8bb643cb2658 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -787,15 +787,9 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
787 goto out; 787 goto out;
788 788
789 for (x = 0; x < num_qd; x++) { 789 for (x = 0; x < num_qd; x++) {
790 int alloc_required;
791
792 offset = qd2offset(qda[x]); 790 offset = qd2offset(qda[x]);
793 error = gfs2_write_alloc_required(ip, offset, 791 if (gfs2_write_alloc_required(ip, offset,
794 sizeof(struct gfs2_quota), 792 sizeof(struct gfs2_quota)))
795 &alloc_required);
796 if (error)
797 goto out_gunlock;
798 if (alloc_required)
799 nalloc++; 793 nalloc++;
800 } 794 }
801 795
@@ -1584,10 +1578,7 @@ static int gfs2_set_dqblk(struct super_block *sb, int type, qid_t id,
1584 goto out_i; 1578 goto out_i;
1585 1579
1586 offset = qd2offset(qd); 1580 offset = qd2offset(qd);
1587 error = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota), 1581 alloc_required = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota));
1588 &alloc_required);
1589 if (error)
1590 goto out_i;
1591 if (alloc_required) { 1582 if (alloc_required) {
1592 al = gfs2_alloc_get(ip); 1583 al = gfs2_alloc_get(ip);
1593 if (al == NULL) 1584 if (al == NULL)