Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357788
b: refs/heads/master
c: f4108a6
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 13, 2013
1 parent 672883d commit 98aab2d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 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: 393551e9898136513007b1e88a25bd4dcdb0d759
refs/heads/master: f4108a607f75b073423eed229ee4f95e5fc10631
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
if (error)
return error;

error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
return error;

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
if (!ht)
return -ENOMEM;

error = gfs2_quota_hold(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_hold(dip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
goto out;

Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
if (error)
return error;

error = gfs2_quota_lock(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_lock(dip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
goto fail;

Expand Down Expand Up @@ -1589,15 +1589,15 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
ngid = attr->ia_gid;

if (!(attr->ia_valid & ATTR_UID) || ouid == nuid)
ouid = nuid = NO_QUOTA_CHANGE;
ouid = nuid = NO_UID_QUOTA_CHANGE;
if (!(attr->ia_valid & ATTR_GID) || ogid == ngid)
ogid = ngid = NO_QUOTA_CHANGE;
ogid = ngid = NO_GID_QUOTA_CHANGE;

error = gfs2_quota_lock(ip, nuid, ngid);
if (error)
return error;

if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) {
error = gfs2_quota_check(ip, nuid, ngid);
if (error)
goto out_gunlock_q;
Expand All @@ -1611,7 +1611,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
if (error)
goto out_end_trans;

if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) {
u64 blocks = gfs2_get_inode_blocks(&ip->i_inode);
gfs2_quota_change(ip, -blocks, ouid, ogid);
gfs2_quota_change(ip, blocks, nuid, ngid);
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/gfs2/quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,15 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
ip->i_res->rs_qa_qd_num++;
qd++;

if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
if (uid != NO_UID_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
error = qdsb_get(sdp, QUOTA_USER, uid, qd);
if (error)
goto out;
ip->i_res->rs_qa_qd_num++;
qd++;
}

if (gid != NO_QUOTA_CHANGE && gid != ip->i_inode.i_gid) {
if (gid != NO_GID_QUOTA_CHANGE && gid != ip->i_inode.i_gid) {
error = qdsb_get(sdp, QUOTA_GROUP, gid, qd);
if (error)
goto out;
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/gfs2/quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ struct gfs2_inode;
struct gfs2_sbd;
struct shrink_control;

#define NO_QUOTA_CHANGE ((u32)-1)
#define NO_UID_QUOTA_CHANGE INVALID_UID
#define NO_GID_QUOTA_CHANGE INVALID_GID

extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid);
extern void gfs2_quota_unhold(struct gfs2_inode *ip);
Expand All @@ -41,7 +42,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
int ret;
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
return 0;
ret = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (ret)
return ret;
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip)
if (error)
return error;

error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
return error;

Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/gfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
if (error)
return error;

error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
goto out_alloc;

Expand Down Expand Up @@ -1461,7 +1461,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
if (error)
return error;

error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
if (error)
return error;

Expand Down

0 comments on commit 98aab2d

Please sign in to comment.