Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357790
b: refs/heads/master
c: 2f6c989
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent fc79b61 commit f5fe7ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: 558e85289fca3d3397882442d1a695936c4f2662
refs/heads/master: 2f6c9896f71e6b6c1c565ea76dd9f5e89579c120
10 changes: 8 additions & 2 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ int gfs2_shrink_qd_memory(struct shrinker *shrink, struct shrink_control *sc)
return (atomic_read(&qd_lru_count) * sysctl_vfs_cache_pressure) / 100;
}

static u64 qd2index(struct gfs2_quota_data *qd)
{
return (2 * (u64)qd->qd_id) +
test_bit(QDF_USER, &qd->qd_flags) ? 0 : 1;
}

static u64 qd2offset(struct gfs2_quota_data *qd)
{
u64 offset;

offset = 2 * (u64)qd->qd_id + !test_bit(QDF_USER, &qd->qd_flags);
offset = qd2index(qd);
offset *= sizeof(struct gfs2_quota);

return offset;
Expand All @@ -147,7 +153,7 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, u32 id,
qd->qd_slot = -1;
INIT_LIST_HEAD(&qd->qd_reclaim);

error = gfs2_glock_get(sdp, 2 * (u64)id + !user,
error = gfs2_glock_get(sdp, qd2index(qd),
&gfs2_quota_glops, CREATE, &qd->qd_gl);
if (error)
goto fail;
Expand Down

0 comments on commit f5fe7ee

Please sign in to comment.