aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijith Das <adas@redhat.com>2007-05-16 18:02:19 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-07-09 03:22:26 -0400
commit2a87ab080607d009b8b2a8706f4e27d70402ca9c (patch)
tree5da4f0b18db776e83797307c9d479e8b6585a776
parentdbb7cae2a36170cd17ffbe286ec0c91a998740ff (diff)
[GFS2] Quotas non-functional - fix bug
This patch fixes an error in the quota code where a 'struct gfs2_quota_lvb*' was being passed to gfs2_adjust_quota() instead of a 'struct gfs2_quota_data*'. Also moved 'struct gfs2_quota_lvb' from fs/gfs2/incore.h to include/linux/gfs2_ondisk.h as per Steve's suggestion. Signed-off-by: Abhijith Das <adas@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/incore.h8
-rw-r--r--fs/gfs2/quota.c4
-rw-r--r--include/linux/gfs2_ondisk.h8
3 files changed, 11 insertions, 9 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 00c3004a4c22..b2079fcd2513 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -275,14 +275,6 @@ enum {
275 QDF_LOCKED = 2, 275 QDF_LOCKED = 2,
276}; 276};
277 277
278struct gfs2_quota_lvb {
279 __be32 qb_magic;
280 u32 __pad;
281 __be64 qb_limit; /* Hard limit of # blocks to alloc */
282 __be64 qb_warn; /* Warn user when alloc is above this # */
283 __be64 qb_value; /* Current # blocks allocated */
284};
285
286struct gfs2_quota_data { 278struct gfs2_quota_data {
287 struct list_head qd_list; 279 struct list_head qd_list;
288 unsigned int qd_count; 280 unsigned int qd_count;
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index c186857e48a8..fcd3ee2c5b96 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -627,6 +627,8 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
627 err = 0; 627 err = 0;
628 qd->qd_qb.qb_magic = cpu_to_be32(GFS2_MAGIC); 628 qd->qd_qb.qb_magic = cpu_to_be32(GFS2_MAGIC);
629 qd->qd_qb.qb_value = cpu_to_be64(value); 629 qd->qd_qb.qb_value = cpu_to_be64(value);
630 ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_magic = cpu_to_be32(GFS2_MAGIC);
631 ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_value = cpu_to_be64(value);
630unlock: 632unlock:
631 unlock_page(page); 633 unlock_page(page);
632 page_cache_release(page); 634 page_cache_release(page);
@@ -709,7 +711,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
709 offset = qd2offset(qd); 711 offset = qd2offset(qd);
710 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync, 712 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync,
711 (struct gfs2_quota_data *) 713 (struct gfs2_quota_data *)
712 qd->qd_gl->gl_lvb); 714 qd);
713 if (error) 715 if (error)
714 goto out_end_trans; 716 goto out_end_trans;
715 717
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index a82ec8c62eff..028f9810ba07 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -500,6 +500,14 @@ struct gfs2_quota_change_host {
500 __u32 qc_id; 500 __u32 qc_id;
501}; 501};
502 502
503struct gfs2_quota_lvb {
504 __be32 qb_magic;
505 u32 __pad;
506 __be64 qb_limit; /* Hard limit of # blocks to alloc */
507 __be64 qb_warn; /* Warn user when alloc is above this # */
508 __be64 qb_value; /* Current # blocks allocated */
509};
510
503#ifdef __KERNEL__ 511#ifdef __KERNEL__
504/* Translation functions */ 512/* Translation functions */
505struct gfs2_inode; 513struct gfs2_inode;