Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38830
b: refs/heads/master
c: 48fac17
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Sep 5, 2006
1 parent 4411b6c commit 1ddf60f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 54 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a67cdbd4579c387c021a17c7447da8b88f2a94f4
refs/heads/master: 48fac1790935ef2f9548d92e7c8ba604d1b80c12
63 changes: 10 additions & 53 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,24 +503,22 @@ void gfs2_quota_unhold(struct gfs2_inode *ip)

static int sort_qd(const void *a, const void *b)
{
struct gfs2_quota_data *qd_a = *(struct gfs2_quota_data **)a;
struct gfs2_quota_data *qd_b = *(struct gfs2_quota_data **)b;
int ret = 0;
const struct gfs2_quota_data *qd_a = *(const struct gfs2_quota_data **)a;
const struct gfs2_quota_data *qd_b = *(const struct gfs2_quota_data **)b;

if (!test_bit(QDF_USER, &qd_a->qd_flags) !=
!test_bit(QDF_USER, &qd_b->qd_flags)) {
if (test_bit(QDF_USER, &qd_a->qd_flags))
ret = -1;
return -1;
else
ret = 1;
} else {
if (qd_a->qd_id < qd_b->qd_id)
ret = -1;
else if (qd_a->qd_id > qd_b->qd_id)
ret = 1;
return 1;
}
if (qd_a->qd_id < qd_b->qd_id)
return -1;
if (qd_a->qd_id > qd_b->qd_id)
return 1;

return ret;
return 0;
}

static void do_qc(struct gfs2_quota_data *qd, s64 change)
Expand Down Expand Up @@ -622,17 +620,13 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
gfs2_trans_add_bh(ip->i_gl, bh, 0);

kaddr = kmap_atomic(page, KM_USER0);
ptr = (__be64 *)(kaddr + offset);
ptr = kaddr + offset;
value = (s64)be64_to_cpu(*ptr) + change;
*ptr = cpu_to_be64(value);
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
err = 0;
qd->qd_qb.qb_magic = cpu_to_be32(GFS2_MAGIC);
#if 0
qd->qd_qb.qb_limit = cpu_to_be64(q.qu_limit);
qd->qd_qb.qb_warn = cpu_to_be64(q.qu_warn);
#endif
qd->qd_qb.qb_value = cpu_to_be64(value);
unlock:
unlock_page(page);
Expand Down Expand Up @@ -1057,43 +1051,6 @@ int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
return error;
}

#if 0
int gfs2_quota_read(struct gfs2_sbd *sdp, int user, u32 id,
struct gfs2_quota *q)
{
struct gfs2_quota_data *qd;
struct gfs2_holder q_gh;
int error;

if (((user) ? (id != current->fsuid) : (!in_group_p(id))) &&
!capable(CAP_SYS_ADMIN))
return -EACCES;

error = qd_get(sdp, user, id, CREATE, &qd);
if (error)
return error;

error = do_glock(qd, NO_FORCE, &q_gh);
if (error)
goto out;

memset(q, 0, sizeof(struct gfs2_quota));
q->qu_limit = be64_to_cpu(qd->qd_qb.qb_limit);
q->qu_warn = be64_to_cpu(qd->qd_qb.qb_warn);
q->qu_value = be64_to_cpu(qd->qd_qb.qb_value);

spin_lock(&sdp->sd_quota_spin);
q->qu_value += qd->qd_change;
spin_unlock(&sdp->sd_quota_spin);

gfs2_glock_dq_uninit(&q_gh);

out:
qd_put(qd);
return error;
}
#endif /* 0 */

int gfs2_quota_init(struct gfs2_sbd *sdp)
{
struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
Expand Down

0 comments on commit 1ddf60f

Please sign in to comment.