aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quota.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r--include/linux/quota.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 570348cbccb1..92547a57e25a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -357,26 +357,25 @@ enum {
357#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ 357#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \
358 DQUOT_SUSPENDED) 358 DQUOT_SUSPENDED)
359/* Other quota flags */ 359/* Other quota flags */
360#define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special 360#define DQUOT_STATE_LAST (_DQUOT_STATE_FLAGS * MAXQUOTAS)
361#define DQUOT_QUOTA_SYS_FILE (1 << DQUOT_STATE_LAST)
362 /* Quota file is a special
361 * system file and user cannot 363 * system file and user cannot
362 * touch it. Filesystem is 364 * touch it. Filesystem is
363 * responsible for setting 365 * responsible for setting
364 * S_NOQUOTA, S_NOATIME flags 366 * S_NOQUOTA, S_NOATIME flags
365 */ 367 */
366#define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ 368#define DQUOT_NEGATIVE_USAGE (1 << (DQUOT_STATE_LAST + 1))
369 /* Allow negative quota usage */
367 370
368static inline unsigned int dquot_state_flag(unsigned int flags, int type) 371static inline unsigned int dquot_state_flag(unsigned int flags, int type)
369{ 372{
370 if (type == USRQUOTA) 373 return flags << _DQUOT_STATE_FLAGS * type;
371 return flags;
372 return flags << _DQUOT_STATE_FLAGS;
373} 374}
374 375
375static inline unsigned int dquot_generic_flag(unsigned int flags, int type) 376static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
376{ 377{
377 if (type == USRQUOTA) 378 return (flags >> _DQUOT_STATE_FLAGS * type) & DQUOT_STATE_FLAGS;
378 return flags;
379 return flags >> _DQUOT_STATE_FLAGS;
380} 379}
381 380
382#ifdef CONFIG_QUOTA_NETLINK_INTERFACE 381#ifdef CONFIG_QUOTA_NETLINK_INTERFACE