// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2000-2005 Silicon Graphics, Inc. * All Rights Reserved.
*/ #ifndef __XFS_QUOTA_DEFS_H__ #define __XFS_QUOTA_DEFS_H__
/* * Quota definitions shared between user and kernel source trees.
*/
/* * Even though users may not have quota limits occupying all 64-bits, * they may need 64-bit accounting. Hence, 64-bit quota-counters, * and quota-limits. This is a waste in the common case, but hey ...
*/ typedef uint64_t xfs_qcnt_t;
/* * flags for q_flags field in the dquot.
*/ #define XFS_DQFLAG_DIRTY (1u << 0) /* dquot is dirty */ #define XFS_DQFLAG_FREEING (1u << 1) /* dquot is being torn down */
/* * We have the possibility of all three quota types being active at once, and * hence free space modification requires modification of all three current * dquots in a single transaction. For this case we need to have a reservation * of at least 3 dquots. * * However, a chmod operation can change both UID and GID in a single * transaction, resulting in requiring {old, new} x {uid, gid} dquots to be * modified. Hence for this case we need to reserve space for at least 4 dquots. * * And in the worst case, there's a rename operation that can be modifying up to * 4 inodes with dquots attached to them. In reality, the only inodes that can * have their dquots modified are the source and destination directory inodes * due to directory name creation and removal. That can require space allocation * and/or freeing on both directory inodes, and hence all three dquots on each * inode can be modified. And if the directories are world writeable, all the * dquots can be unique and so 6 dquots can be modified.... * * And, of course, we also need to take into account the dquot log format item * used to describe each dquot.
*/ #define XFS_DQUOT_LOGRES \
((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
/* * Flags to tell various functions what to do. Not all of these are meaningful * to a single function. None of these XFS_QMOPT_* flags are meant to have * persistent values (ie. their values can and will change between versions)
*/ #define XFS_QMOPT_UQUOTA (1u << 0) /* user dquot requested */ #define XFS_QMOPT_GQUOTA (1u << 1) /* group dquot requested */ #define XFS_QMOPT_PQUOTA (1u << 2) /* project dquot requested */ #define XFS_QMOPT_FORCE_RES (1u << 3) /* ignore quota limits */ #define XFS_QMOPT_SBVERSION (1u << 4) /* change superblock version num */
/* * flags to xfs_trans_mod_dquot to indicate which field needs to be * modified.
*/ #define XFS_QMOPT_RES_REGBLKS (1u << 7) #define XFS_QMOPT_RES_RTBLKS (1u << 8) #define XFS_QMOPT_BCOUNT (1u << 9) #define XFS_QMOPT_ICOUNT (1u << 10) #define XFS_QMOPT_RTBCOUNT (1u << 11) #define XFS_QMOPT_DELBCOUNT (1u << 12) #define XFS_QMOPT_DELRTBCOUNT (1u << 13) #define XFS_QMOPT_RES_INOS (1u << 14)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.