diff options
author | Jan Kara <jack@suse.cz> | 2015-03-16 05:26:41 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2015-03-16 05:26:41 -0400 |
commit | 7dca0548a21e5efa445b68a73554ef863e09c623 (patch) | |
tree | 816483928c6da02928a256fb64617071f98552ed /include/linux/quota.h | |
parent | 1be440de2ac5181495a7295fa9a4c8ad0793f056 (diff) | |
parent | c39fb53b48c851b185c22548153581d78f2acc11 (diff) |
Merge branch 'quota_interface' into for_next_testing
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r-- | include/linux/quota.h | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index a3374dc3a91b..cf910d1f8efa 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -344,7 +344,10 @@ struct qc_dqblk { | |||
344 | int d_rt_spc_warns; /* # warnings issued wrt RT space */ | 344 | int d_rt_spc_warns; /* # warnings issued wrt RT space */ |
345 | }; | 345 | }; |
346 | 346 | ||
347 | /* Field specifiers for ->set_dqblk() in struct qc_dqblk */ | 347 | /* |
348 | * Field specifiers for ->set_dqblk() in struct qc_dqblk and also for | ||
349 | * ->set_info() in struct qc_info | ||
350 | */ | ||
348 | #define QC_INO_SOFT (1<<0) | 351 | #define QC_INO_SOFT (1<<0) |
349 | #define QC_INO_HARD (1<<1) | 352 | #define QC_INO_HARD (1<<1) |
350 | #define QC_SPC_SOFT (1<<2) | 353 | #define QC_SPC_SOFT (1<<2) |
@@ -365,6 +368,51 @@ struct qc_dqblk { | |||
365 | #define QC_INO_COUNT (1<<13) | 368 | #define QC_INO_COUNT (1<<13) |
366 | #define QC_RT_SPACE (1<<14) | 369 | #define QC_RT_SPACE (1<<14) |
367 | #define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) | 370 | #define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) |
371 | #define QC_FLAGS (1<<15) | ||
372 | |||
373 | #define QCI_SYSFILE (1 << 0) /* Quota file is hidden from userspace */ | ||
374 | #define QCI_ROOT_SQUASH (1 << 1) /* Root squash turned on */ | ||
375 | #define QCI_ACCT_ENABLED (1 << 2) /* Quota accounting enabled */ | ||
376 | #define QCI_LIMITS_ENFORCED (1 << 3) /* Quota limits enforced */ | ||
377 | |||
378 | /* Structures for communicating via ->get_state */ | ||
379 | struct qc_type_state { | ||
380 | unsigned int flags; /* Flags QCI_* */ | ||
381 | unsigned int spc_timelimit; /* Time after which space softlimit is | ||
382 | * enforced */ | ||
383 | unsigned int ino_timelimit; /* Ditto for inode softlimit */ | ||
384 | unsigned int rt_spc_timelimit; /* Ditto for real-time space */ | ||
385 | unsigned int spc_warnlimit; /* Limit for number of space warnings */ | ||
386 | unsigned int ino_warnlimit; /* Ditto for inodes */ | ||
387 | unsigned int rt_spc_warnlimit; /* Ditto for real-time space */ | ||
388 | unsigned long long ino; /* Inode number of quota file */ | ||
389 | blkcnt_t blocks; /* Number of 512-byte blocks in the file */ | ||
390 | blkcnt_t nextents; /* Number of extents in the file */ | ||
391 | }; | ||
392 | |||
393 | struct qc_state { | ||
394 | unsigned int s_incoredqs; /* Number of dquots in core */ | ||
395 | /* | ||
396 | * Per quota type information. The array should really have | ||
397 | * max(MAXQUOTAS, XQM_MAXQUOTAS) entries. BUILD_BUG_ON in | ||
398 | * quota_getinfo() makes sure XQM_MAXQUOTAS is large enough. Once VFS | ||
399 | * supports project quotas, this can be changed to MAXQUOTAS | ||
400 | */ | ||
401 | struct qc_type_state s_state[XQM_MAXQUOTAS]; | ||
402 | }; | ||
403 | |||
404 | /* Structure for communicating via ->set_info */ | ||
405 | struct qc_info { | ||
406 | int i_fieldmask; /* mask of fields to change in ->set_info() */ | ||
407 | unsigned int i_flags; /* Flags QCI_* */ | ||
408 | unsigned int i_spc_timelimit; /* Time after which space softlimit is | ||
409 | * enforced */ | ||
410 | unsigned int i_ino_timelimit; /* Ditto for inode softlimit */ | ||
411 | unsigned int i_rt_spc_timelimit;/* Ditto for real-time space */ | ||
412 | unsigned int i_spc_warnlimit; /* Limit for number of space warnings */ | ||
413 | unsigned int i_ino_warnlimit; /* Limit for number of inode warnings */ | ||
414 | unsigned int i_rt_spc_warnlimit; /* Ditto for real-time space */ | ||
415 | }; | ||
368 | 416 | ||
369 | /* Operations handling requests from userspace */ | 417 | /* Operations handling requests from userspace */ |
370 | struct quotactl_ops { | 418 | struct quotactl_ops { |
@@ -373,12 +421,10 @@ struct quotactl_ops { | |||
373 | int (*quota_enable)(struct super_block *, unsigned int); | 421 | int (*quota_enable)(struct super_block *, unsigned int); |
374 | int (*quota_disable)(struct super_block *, unsigned int); | 422 | int (*quota_disable)(struct super_block *, unsigned int); |
375 | int (*quota_sync)(struct super_block *, int); | 423 | int (*quota_sync)(struct super_block *, int); |
376 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 424 | int (*set_info)(struct super_block *, int, struct qc_info *); |
377 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | ||
378 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 425 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
379 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 426 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
380 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 427 | int (*get_state)(struct super_block *, struct qc_state *); |
381 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); | ||
382 | int (*rm_xquota)(struct super_block *, unsigned int); | 428 | int (*rm_xquota)(struct super_block *, unsigned int); |
383 | }; | 429 | }; |
384 | 430 | ||