aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quota.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-11-18 18:42:09 -0500
committerJan Kara <jack@suse.cz>2015-03-04 10:06:34 -0500
commit0a240339a8deeb13a19043389bba4285a6c0592e (patch)
tree120787c36bd95904ec06a3bf41820f5f0a08e22b /include/linux/quota.h
parent023a6007a08d342b64895a7342e426d12d9627dd (diff)
quota: Make VFS quotas use new interface for getting quota info
Create new internal interface for getting information about quota which contains everything needed for both VFS quotas and XFS quotas. Make VFS use this and hook it up to Q_GETINFO. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r--include/linux/quota.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index d534e8ed308a..6ecac0f3b2ca 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -366,6 +366,37 @@ struct qc_dqblk {
366#define QC_RT_SPACE (1<<14) 366#define QC_RT_SPACE (1<<14)
367#define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) 367#define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE)
368 368
369#define QCI_SYSFILE (1 << 0) /* Quota file is hidden from userspace */
370#define QCI_ROOT_SQUASH (1 << 1) /* Root squash turned on */
371#define QCI_ACCT_ENABLED (1 << 2) /* Quota accounting enabled */
372#define QCI_LIMITS_ENFORCED (1 << 3) /* Quota limits enforced */
373
374/* Structures for communicating via ->get_state */
375struct qc_type_state {
376 unsigned int flags; /* Flags QCI_* */
377 unsigned int spc_timelimit; /* Time after which space softlimit is
378 * enforced */
379 unsigned int ino_timelimit; /* Ditto for inode softlimit */
380 unsigned int rt_spc_timelimit; /* Ditto for real-time space */
381 unsigned int spc_warnlimit; /* Limit for number of space warnings */
382 unsigned int ino_warnlimit; /* Ditto for inodes */
383 unsigned int rt_spc_warnlimit; /* Ditto for real-time space */
384 unsigned long long ino; /* Inode number of quota file */
385 blkcnt_t blocks; /* Number of 512-byte blocks in the file */
386 blkcnt_t nextents; /* Number of extents in the file */
387};
388
389struct qc_state {
390 unsigned int s_incoredqs; /* Number of dquots in core */
391 /*
392 * Per quota type information. The array should really have
393 * max(MAXQUOTAS, XQM_MAXQUOTAS) entries. BUILD_BUG_ON in
394 * quota_getinfo() makes sure XQM_MAXQUOTAS is large enough. Once VFS
395 * supports project quotas, this can be changed to MAXQUOTAS
396 */
397 struct qc_type_state s_state[XQM_MAXQUOTAS];
398};
399
369/* Operations handling requests from userspace */ 400/* Operations handling requests from userspace */
370struct quotactl_ops { 401struct quotactl_ops {
371 int (*quota_on)(struct super_block *, int, int, struct path *); 402 int (*quota_on)(struct super_block *, int, int, struct path *);
@@ -373,10 +404,10 @@ struct quotactl_ops {
373 int (*quota_enable)(struct super_block *, unsigned int); 404 int (*quota_enable)(struct super_block *, unsigned int);
374 int (*quota_disable)(struct super_block *, unsigned int); 405 int (*quota_disable)(struct super_block *, unsigned int);
375 int (*quota_sync)(struct super_block *, int); 406 int (*quota_sync)(struct super_block *, int);
376 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
377 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 407 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
378 int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); 408 int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
379 int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); 409 int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *);
410 int (*get_state)(struct super_block *, struct qc_state *);
380 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 411 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
381 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); 412 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);
382 int (*rm_xquota)(struct super_block *, unsigned int); 413 int (*rm_xquota)(struct super_block *, unsigned int);