Skip to content

Commit af1db8f

Browse files
committed
xfs: remove unnecessary quota type masking
When XFS' quota functions take a parameter for the quota type, they only care about the three quota record types (user, group, project). Internal state flags and whatnot should never be passed by callers and are an error. Now that we've moved responsibility for filtering out internal state to the callers, we can drop the masking everywhere else. In other words, if you call a quota function, you must only pass in one of XFS_DQTYPE_{USER,GROUP,PROJ}. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 0b04dd5 commit af1db8f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/xfs/xfs_dquot.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ xfs_dquot_type(const struct xfs_dquot *dqp)
136136

137137
static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
138138
{
139-
switch (type & XFS_DQTYPE_REC_MASK) {
139+
switch (type) {
140140
case XFS_DQTYPE_USER:
141141
return XFS_IS_UQUOTA_ON(mp);
142142
case XFS_DQTYPE_GROUP:
@@ -150,7 +150,7 @@ static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
150150

151151
static inline struct xfs_dquot *xfs_inode_dquot(struct xfs_inode *ip, int type)
152152
{
153-
switch (type & XFS_DQTYPE_REC_MASK) {
153+
switch (type) {
154154
case XFS_DQTYPE_USER:
155155
return ip->i_udquot;
156156
case XFS_DQTYPE_GROUP:

fs/xfs/xfs_qm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ xfs_dquot_tree(
8888
static inline struct xfs_inode *
8989
xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
9090
{
91-
switch (dq_flags & XFS_DQTYPE_REC_MASK) {
91+
switch (dq_flags) {
9292
case XFS_DQTYPE_USER:
9393
return mp->m_quotainfo->qi_uquotaip;
9494
case XFS_DQTYPE_GROUP:

0 commit comments

Comments
 (0)