#define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
#define XFS_DQUOT_VERSION (uint8_t)0x01 /* latest version number */
+#define XFS_DQTYPE_USER 0x01 /* user dquot record */
+#define XFS_DQTYPE_PROJ 0x02 /* project dquot record */
+#define XFS_DQTYPE_GROUP 0x04 /* group dquot record */
+
+/* bitmask to determine if this is a user/group/project dquot */
+#define XFS_DQTYPE_REC_MASK (XFS_DQTYPE_USER | \
+ XFS_DQTYPE_PROJ | \
+ XFS_DQTYPE_GROUP)
+
/*
* This is the main portion of the on-disk representation of quota information
* for a user. We pad this with some more expansion room to construct the on
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" }
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__ */
struct avl64tree_desc tree;
/* One of XFS_DQTYPE_USER/PROJ/GROUP */
- uint16_t type;
+ xfs_dqtype_t type;
};
#define qc_dquots_foreach(dquots, pos, n) \
static const char *
qflags_typestr(
- unsigned int type)
+ xfs_dqtype_t type)
{
if (type & XFS_DQTYPE_USER)
return _("user quota");
void
quotacheck_verify(
struct xfs_mount *mp,
- unsigned int type)
+ xfs_dqtype_t type)
{
struct xfs_bmbt_irec map;
struct xfs_iext_cursor icur;
static inline bool
qc_has_quotafile(
struct xfs_mount *mp,
- unsigned int type)
+ xfs_dqtype_t type)
{
bool lost;
xfs_ino_t ino;
/* Initialize an incore dquot tree. */
static struct qc_dquots *
qc_dquots_init(
- uint16_t type)
+ xfs_dqtype_t type)
{
struct qc_dquots *dquots;
void quotacheck_skip(void);
void quotacheck_adjust(struct xfs_mount *mp, xfs_ino_t ino);
-void quotacheck_verify(struct xfs_mount *mp, unsigned int type);
+void quotacheck_verify(struct xfs_mount *mp, xfs_dqtype_t type);
uint16_t quotacheck_results(void);
int quotacheck_setup(struct xfs_mount *mp);
void quotacheck_teardown(void);