diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-07-15 17:53:43 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-07-28 20:24:14 -0700 |
commit | 1a7ed271653a4f418a6398465f861ee795d34468 (patch) | |
tree | 595141cdbc3cda946dbdbdd0a025356092d21d20 /fs/xfs/libxfs/xfs_quota_defs.h | |
parent | 74ddd6b3dd553a48c294d671a6cfe02e57cfa4c7 (diff) | |
download | linux-1a7ed271653a4f418a6398465f861ee795d34468.tar.bz2 |
xfs: create xfs_dqtype_t to represent quota types
Create a new type (xfs_dqtype_t) to represent the type of an incore
dquot (user, group, project, or none). Rename the incore dquot's
dq_flags field to q_type.
This allows us to replace all the "uint type" arguments to the quota
functions with "xfs_dqtype_t type", to make it obvious when we're
passing a quota type argument into a function.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_quota_defs.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_quota_defs.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h index baf6c4ad88af..076bdc7037ee 100644 --- a/fs/xfs/libxfs/xfs_quota_defs.h +++ b/fs/xfs/libxfs/xfs_quota_defs.h @@ -18,23 +18,20 @@ typedef uint64_t xfs_qcnt_t; typedef uint16_t xfs_qwarncnt_t; +typedef uint8_t xfs_dqtype_t; + +#define XFS_DQTYPE_STRINGS \ + { XFS_DQTYPE_USER, "USER" }, \ + { XFS_DQTYPE_PROJ, "PROJ" }, \ + { XFS_DQTYPE_GROUP, "GROUP" } + /* * flags for q_flags field in the dquot. */ -#define XFS_DQTYPE_USER 0x0001 /* a user quota */ -#define XFS_DQTYPE_PROJ 0x0002 /* project quota */ -#define XFS_DQTYPE_GROUP 0x0004 /* a group quota */ -#define XFS_DQFLAG_DIRTY 0x0008 /* dquot is dirty */ -#define XFS_DQFLAG_FREEING 0x0010 /* dquot is being torn down */ - -#define XFS_DQTYPE_REC_MASK (XFS_DQTYPE_USER | \ - XFS_DQTYPE_PROJ | \ - XFS_DQTYPE_GROUP) +#define XFS_DQFLAG_DIRTY (1 << 0) /* dquot is dirty */ +#define XFS_DQFLAG_FREEING (1 << 1) /* dquot is being torn down */ #define XFS_DQFLAG_STRINGS \ - { XFS_DQTYPE_USER, "USER" }, \ - { XFS_DQTYPE_PROJ, "PROJ" }, \ - { XFS_DQTYPE_GROUP, "GROUP" }, \ { XFS_DQFLAG_DIRTY, "DIRTY" }, \ { XFS_DQFLAG_FREEING, "FREEING" } @@ -144,6 +141,6 @@ extern xfs_failaddr_t xfs_dqblk_verify(struct xfs_mount *mp, struct xfs_dqblk *dqb, xfs_dqid_t id); extern int xfs_calc_dquots_per_chunk(unsigned int nbblks); extern void xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb, - xfs_dqid_t id, uint type); + xfs_dqid_t id, xfs_dqtype_t type); #endif /* __XFS_QUOTA_H__ */ |