Skip to content

Commit f4108a6

Browse files
committed
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>
1 parent 393551e commit f4108a6

7 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎fs/gfs2/bmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ static int trunc_dealloc(struct gfs2_inode *ip, u64 size)
10981098
if (error)
10991099
return error;
11001100

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);
11021102
if (error)
11031103
return error;
11041104

‎fs/gfs2/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
18491849
if (!ht)
18501850
return -ENOMEM;
18511851

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);
18531853
if (error)
18541854
goto out;
18551855

‎fs/gfs2/inode.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
548548
if (error)
549549
return error;
550550

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);
552552
if (error)
553553
goto fail;
554554

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

15911591
if (!(attr->ia_valid & ATTR_UID) || ouid == nuid)
1592-
ouid = nuid = NO_QUOTA_CHANGE;
1592+
ouid = nuid = NO_UID_QUOTA_CHANGE;
15931593
if (!(attr->ia_valid & ATTR_GID) || ogid == ngid)
1594-
ogid = ngid = NO_QUOTA_CHANGE;
1594+
ogid = ngid = NO_GID_QUOTA_CHANGE;
15951595

15961596
error = gfs2_quota_lock(ip, nuid, ngid);
15971597
if (error)
15981598
return error;
15991599

1600-
if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
1600+
if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) {
16011601
error = gfs2_quota_check(ip, nuid, ngid);
16021602
if (error)
16031603
goto out_gunlock_q;
@@ -1611,7 +1611,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
16111611
if (error)
16121612
goto out_end_trans;
16131613

1614-
if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE) {
1614+
if (ouid != NO_UID_QUOTA_CHANGE || ogid != NO_GID_QUOTA_CHANGE) {
16151615
u64 blocks = gfs2_get_inode_blocks(&ip->i_inode);
16161616
gfs2_quota_change(ip, -blocks, ouid, ogid);
16171617
gfs2_quota_change(ip, blocks, nuid, ngid);

‎fs/gfs2/quota.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,15 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
524524
ip->i_res->rs_qa_qd_num++;
525525
qd++;
526526

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) {
528528
error = qdsb_get(sdp, QUOTA_USER, uid, qd);
529529
if (error)
530530
goto out;
531531
ip->i_res->rs_qa_qd_num++;
532532
qd++;
533533
}
534534

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) {
536536
error = qdsb_get(sdp, QUOTA_GROUP, gid, qd);
537537
if (error)
538538
goto out;

‎fs/gfs2/quota.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ struct gfs2_inode;
1414
struct gfs2_sbd;
1515
struct shrink_control;
1616

17-
#define NO_QUOTA_CHANGE ((u32)-1)
17+
#define NO_UID_QUOTA_CHANGE INVALID_UID
18+
#define NO_GID_QUOTA_CHANGE INVALID_GID
1819

1920
extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid);
2021
extern void gfs2_quota_unhold(struct gfs2_inode *ip);
@@ -41,7 +42,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
4142
int ret;
4243
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
4344
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);
4546
if (ret)
4647
return ret;
4748
if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)

‎fs/gfs2/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip)
14291429
if (error)
14301430
return error;
14311431

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);
14331433
if (error)
14341434
return error;
14351435

‎fs/gfs2/xattr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
331331
if (error)
332332
return error;
333333

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);
335335
if (error)
336336
goto out_alloc;
337337

@@ -1461,7 +1461,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
14611461
if (error)
14621462
return error;
14631463

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);
14651465
if (error)
14661466
return error;
14671467

0 commit comments

Comments
 (0)