diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-01-31 20:49:26 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:15:01 -0500 |
commit | f4108a607f75b073423eed229ee4f95e5fc10631 (patch) | |
tree | 3e950c8c7707b04e500d455950e3e57d292f7d1b /fs/gfs2 | |
parent | 393551e9898136513007b1e88a25bd4dcdb0d759 (diff) |
gfs2: Split NO_QUOTA_CHANGE inot NO_UID_QUTOA_CHANGE and NO_GID_QUTOA_CHANGE
Split NO_QUOTA_CHANGE into NO_UID_QUTOA_CHANGE and NO_GID_QUTOA_CHANGE
so the constants may be well typed.
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/bmap.c | 2 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 2 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 10 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 4 | ||||
-rw-r--r-- | fs/gfs2/quota.h | 5 | ||||
-rw-r--r-- | fs/gfs2/super.c | 2 | ||||
-rw-r--r-- | fs/gfs2/xattr.c | 4 |
7 files changed, 15 insertions, 14 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index a68e91bcef3d..10c54e3c2e72 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -1098,7 +1098,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size) | |||
1098 | if (error) | 1098 | if (error) |
1099 | return error; | 1099 | return error; |
1100 | 1100 | ||
1101 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1101 | error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
1102 | if (error) | 1102 | if (error) |
1103 | return error; | 1103 | return error; |
1104 | 1104 | ||
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 9a35670fdc38..6d3e3e2cabf8 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1849,7 +1849,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, | |||
1849 | if (!ht) | 1849 | if (!ht) |
1850 | return -ENOMEM; | 1850 | return -ENOMEM; |
1851 | 1851 | ||
1852 | error = gfs2_quota_hold(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1852 | error = gfs2_quota_hold(dip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
1853 | if (error) | 1853 | if (error) |
1854 | goto out; | 1854 | goto out; |
1855 | 1855 | ||
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 2b6f5698ef18..aa1050287f3c 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -548,7 +548,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name, | |||
548 | if (error) | 548 | if (error) |
549 | return error; | 549 | return error; |
550 | 550 | ||
551 | error = gfs2_quota_lock(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 551 | error = gfs2_quota_lock(dip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
552 | if (error) | 552 | if (error) |
553 | goto fail; | 553 | goto fail; |
554 | 554 | ||
@@ -1589,15 +1589,15 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) | |||
1589 | ngid = attr->ia_gid; | 1589 | ngid = attr->ia_gid; |
1590 | 1590 | ||
1591 | if (!(attr->ia_valid & ATTR_UID) || ouid == nuid) | 1591 | if (!(attr->ia_valid & ATTR_UID) || ouid == nuid) |
1592 | ouid = nuid = NO_QUOTA_CHANGE; | 1592 | ouid = nuid = NO_UID_QUOTA_CHANGE; |
1593 | if (!(attr->ia_valid & ATTR_GID) || ogid == ngid) | 1593 | if (!(attr->ia_valid & ATTR_GID) || ogid == ngid) |
1594 | ogid = ngid = NO_QUOTA_CHANGE; | 1594 | ogid = ngid = NO_GID_QUOTA_CHANGE; |
1595 | 1595 | ||
1596 | error = gfs2_quota_lock(ip, nuid, ngid); | 1596 | error = gfs2_quota_lock(ip, nuid, ngid); |
1597 | if (error) | 1597 | if (error) |
1598 | return error; | 1598 | return error; |
1599 | 1599 | ||
1600 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { | 1600 | if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) { |
1601 | error = gfs2_quota_check(ip, nuid, ngid); | 1601 | error = gfs2_quota_check(ip, nuid, ngid); |
1602 | if (error) | 1602 | if (error) |
1603 | goto out_gunlock_q; | 1603 | goto out_gunlock_q; |
@@ -1611,7 +1611,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr) | |||
1611 | if (error) | 1611 | if (error) |
1612 | goto out_end_trans; | 1612 | goto out_end_trans; |
1613 | 1613 | ||
1614 | if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) { | 1614 | if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) { |
1615 | u64 blocks = gfs2_get_inode_blocks(&ip->i_inode); | 1615 | u64 blocks = gfs2_get_inode_blocks(&ip->i_inode); |
1616 | gfs2_quota_change(ip, -blocks, ouid, ogid); | 1616 | gfs2_quota_change(ip, -blocks, ouid, ogid); |
1617 | gfs2_quota_change(ip, blocks, nuid, ngid); | 1617 | gfs2_quota_change(ip, blocks, nuid, ngid); |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index e4f6ccf3da64..dbfacaa8b6fb 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -524,7 +524,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
524 | ip->i_res->rs_qa_qd_num++; | 524 | ip->i_res->rs_qa_qd_num++; |
525 | qd++; | 525 | qd++; |
526 | 526 | ||
527 | if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) { | 527 | if (uid != NO_UID_QUOTA_CHANGE && uid != ip->i_inode.i_uid) { |
528 | error = qdsb_get(sdp, QUOTA_USER, uid, qd); | 528 | error = qdsb_get(sdp, QUOTA_USER, uid, qd); |
529 | if (error) | 529 | if (error) |
530 | goto out; | 530 | goto out; |
@@ -532,7 +532,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid) | |||
532 | qd++; | 532 | qd++; |
533 | } | 533 | } |
534 | 534 | ||
535 | if (gid != NO_QUOTA_CHANGE && gid != ip->i_inode.i_gid) { | 535 | if (gid != NO_GID_QUOTA_CHANGE && gid != ip->i_inode.i_gid) { |
536 | error = qdsb_get(sdp, QUOTA_GROUP, gid, qd); | 536 | error = qdsb_get(sdp, QUOTA_GROUP, gid, qd); |
537 | if (error) | 537 | if (error) |
538 | goto out; | 538 | goto out; |
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h index f25d98b87904..7f67323a6a72 100644 --- a/fs/gfs2/quota.h +++ b/fs/gfs2/quota.h | |||
@@ -14,7 +14,8 @@ struct gfs2_inode; | |||
14 | struct gfs2_sbd; | 14 | struct gfs2_sbd; |
15 | struct shrink_control; | 15 | struct shrink_control; |
16 | 16 | ||
17 | #define NO_QUOTA_CHANGE ((u32)-1) | 17 | #define NO_UID_QUOTA_CHANGE INVALID_UID |
18 | #define NO_GID_QUOTA_CHANGE INVALID_GID | ||
18 | 19 | ||
19 | extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid); | 20 | extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid); |
20 | extern void gfs2_quota_unhold(struct gfs2_inode *ip); | 21 | extern void gfs2_quota_unhold(struct gfs2_inode *ip); |
@@ -41,7 +42,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) | |||
41 | int ret; | 42 | int ret; |
42 | if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) | 43 | if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) |
43 | return 0; | 44 | return 0; |
44 | ret = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 45 | ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
45 | if (ret) | 46 | if (ret) |
46 | return ret; | 47 | return ret; |
47 | if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON) | 48 | if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON) |
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index d6488674d916..7cc5a6054547 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -1429,7 +1429,7 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
1429 | if (error) | 1429 | if (error) |
1430 | return error; | 1430 | return error; |
1431 | 1431 | ||
1432 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1432 | error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
1433 | if (error) | 1433 | if (error) |
1434 | return error; | 1434 | return error; |
1435 | 1435 | ||
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 76c144b3c9bb..80c25ae79048 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -331,7 +331,7 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
331 | if (error) | 331 | if (error) |
332 | return error; | 332 | return error; |
333 | 333 | ||
334 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 334 | error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
335 | if (error) | 335 | if (error) |
336 | goto out_alloc; | 336 | goto out_alloc; |
337 | 337 | ||
@@ -1461,7 +1461,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip) | |||
1461 | if (error) | 1461 | if (error) |
1462 | return error; | 1462 | return error; |
1463 | 1463 | ||
1464 | error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 1464 | error = gfs2_quota_hold(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
1465 | if (error) | 1465 | if (error) |
1466 | return error; | 1466 | return error; |
1467 | 1467 | ||