diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-01-31 22:35:56 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:15:05 -0500 |
commit | b59c8b6f9d1b1220e5ed72152f42a658bf739d90 (patch) | |
tree | 0a536e79d7f33798675d3fc82db0f63d6359c78c /fs/gfs2 | |
parent | e08d8d7f201dc1e64f5d9d5aa2cd4f37aecaaab4 (diff) |
gfs2: Modify qdsb_get to take a struct kqid
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/quota.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 02913e95491c..20762ae2a9c4 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -464,12 +464,13 @@ static void qd_unlock(struct gfs2_quota_data *qd) | |||
464 | qd_put(qd); | 464 | qd_put(qd); |
465 | } | 465 | } |
466 | 466 | ||
467 | static int qdsb_get(struct gfs2_sbd *sdp, int user, u32 id, | 467 | static int qdsb_get(struct gfs2_sbd *sdp, struct kqid qid, |
468 | struct gfs2_quota_data **qdp) | 468 | struct gfs2_quota_data **qdp) |
469 | { | 469 | { |
470 | int error; | 470 | int error; |
471 | 471 | ||
472 | error = qd_get(sdp, user, id, qdp); | 472 | error = qd_get(sdp, qid.type == USRQUOTA ? QUOTA_USER : QUOTA_GROUP, |
473 | from_kqid(&init_user_ns, qid), qdp); | ||
473 | if (error) | 474 | if (error) |
474 | return error; | 475 | return error; |
475 | 476 | ||
@@ -518,20 +519,20 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
518 | if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) | 519 | if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) |
519 | return 0; | 520 | return 0; |
520 | 521 | ||
521 | error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, qd); | 522 | error = qdsb_get(sdp, make_kqid_uid(ip->i_inode.i_uid), qd); |
522 | if (error) | 523 | if (error) |
523 | goto out; | 524 | goto out; |
524 | ip->i_res->rs_qa_qd_num++; | 525 | ip->i_res->rs_qa_qd_num++; |
525 | qd++; | 526 | qd++; |
526 | 527 | ||
527 | error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, qd); | 528 | error = qdsb_get(sdp, make_kqid_gid(ip->i_inode.i_gid), qd); |
528 | if (error) | 529 | if (error) |
529 | goto out; | 530 | goto out; |
530 | ip->i_res->rs_qa_qd_num++; | 531 | ip->i_res->rs_qa_qd_num++; |
531 | qd++; | 532 | qd++; |
532 | 533 | ||
533 | if (uid != NO_UID_QUOTA_CHANGE && uid != ip->i_inode.i_uid) { | 534 | if (uid != NO_UID_QUOTA_CHANGE && uid != ip->i_inode.i_uid) { |
534 | error = qdsb_get(sdp, QUOTA_USER, uid, qd); | 535 | error = qdsb_get(sdp, make_kqid_uid(uid), qd); |
535 | if (error) | 536 | if (error) |
536 | goto out; | 537 | goto out; |
537 | ip->i_res->rs_qa_qd_num++; | 538 | ip->i_res->rs_qa_qd_num++; |
@@ -539,7 +540,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
539 | } | 540 | } |
540 | 541 | ||
541 | if (gid != NO_GID_QUOTA_CHANGE && gid != ip->i_inode.i_gid) { | 542 | if (gid != NO_GID_QUOTA_CHANGE && gid != ip->i_inode.i_gid) { |
542 | error = qdsb_get(sdp, QUOTA_GROUP, gid, qd); | 543 | error = qdsb_get(sdp, make_kqid_gid(gid), qd); |
543 | if (error) | 544 | if (error) |
544 | goto out; | 545 | goto out; |
545 | ip->i_res->rs_qa_qd_num++; | 546 | ip->i_res->rs_qa_qd_num++; |