Skip to content

Commit

Permalink
xfs: remove unnecessary quota type masking
Browse files Browse the repository at this point in the history
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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Darrick J. Wong committed Jul 29, 2020
1 parent 0b04dd5 commit af1db8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fs/xfs/xfs_dquot.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ xfs_dquot_type(const struct xfs_dquot *dqp)

static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
{
switch (type & XFS_DQTYPE_REC_MASK) {
switch (type) {
case XFS_DQTYPE_USER:
return XFS_IS_UQUOTA_ON(mp);
case XFS_DQTYPE_GROUP:
Expand All @@ -150,7 +150,7 @@ static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)

static inline struct xfs_dquot *xfs_inode_dquot(struct xfs_inode *ip, int type)
{
switch (type & XFS_DQTYPE_REC_MASK) {
switch (type) {
case XFS_DQTYPE_USER:
return ip->i_udquot;
case XFS_DQTYPE_GROUP:
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_qm.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ xfs_dquot_tree(
static inline struct xfs_inode *
xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
{
switch (dq_flags & XFS_DQTYPE_REC_MASK) {
switch (dq_flags) {
case XFS_DQTYPE_USER:
return mp->m_quotainfo->qi_uquotaip;
case XFS_DQTYPE_GROUP:
Expand Down

0 comments on commit af1db8f

Please sign in to comment.