diff options
| author | Jan Kara <jack@suse.cz> | 2014-12-16 06:03:51 -0500 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2015-03-04 10:06:38 -0500 |
| commit | 5eacb2ac029161d94969a511e0adf7dca28cda1f (patch) | |
| tree | f49c47630dbd2790ae4d297f745f6ab359525ed9 /include/linux | |
| parent | 59b6ba699043e0f55d4057cf2ae79d9c1171bc58 (diff) | |
quota: Make ->set_info use structure with neccesary info to VFS and XFS
Change ->set_info to take new qc_info structure which contains all the
necessary information both for XFS and VFS. Convert Q_SETINFO handler
to use this structure.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/quota.h | 21 | ||||
| -rw-r--r-- | include/linux/quotaops.h | 2 |
2 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index a07f2ed25284..3d521199a0bd 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,7 @@ 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) | ||
| 368 | 372 | ||
| 369 | #define QCI_SYSFILE (1 << 0) /* Quota file is hidden from userspace */ | 373 | #define QCI_SYSFILE (1 << 0) /* Quota file is hidden from userspace */ |
| 370 | #define QCI_ROOT_SQUASH (1 << 1) /* Root squash turned on */ | 374 | #define QCI_ROOT_SQUASH (1 << 1) /* Root squash turned on */ |
| @@ -397,6 +401,19 @@ struct qc_state { | |||
| 397 | struct qc_type_state s_state[XQM_MAXQUOTAS]; | 401 | struct qc_type_state s_state[XQM_MAXQUOTAS]; |
| 398 | }; | 402 | }; |
| 399 | 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 | }; | ||
| 416 | |||
| 400 | /* Operations handling requests from userspace */ | 417 | /* Operations handling requests from userspace */ |
| 401 | struct quotactl_ops { | 418 | struct quotactl_ops { |
| 402 | int (*quota_on)(struct super_block *, int, int, struct path *); | 419 | int (*quota_on)(struct super_block *, int, int, struct path *); |
| @@ -404,7 +421,7 @@ struct quotactl_ops { | |||
| 404 | int (*quota_enable)(struct super_block *, unsigned int); | 421 | int (*quota_enable)(struct super_block *, unsigned int); |
| 405 | int (*quota_disable)(struct super_block *, unsigned int); | 422 | int (*quota_disable)(struct super_block *, unsigned int); |
| 406 | int (*quota_sync)(struct super_block *, int); | 423 | int (*quota_sync)(struct super_block *, int); |
| 407 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 424 | int (*set_info)(struct super_block *, int, struct qc_info *); |
| 408 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 425 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 409 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); | 426 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 410 | int (*get_state)(struct super_block *, struct qc_state *); | 427 | int (*get_state)(struct super_block *, struct qc_state *); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 6509a29523e2..9f4b07ba9e8c 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -96,7 +96,7 @@ int dquot_quota_off(struct super_block *sb, int type); | |||
| 96 | int dquot_writeback_dquots(struct super_block *sb, int type); | 96 | int dquot_writeback_dquots(struct super_block *sb, int type); |
| 97 | int dquot_quota_sync(struct super_block *sb, int type); | 97 | int dquot_quota_sync(struct super_block *sb, int type); |
| 98 | int dquot_get_state(struct super_block *sb, struct qc_state *state); | 98 | int dquot_get_state(struct super_block *sb, struct qc_state *state); |
| 99 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 99 | int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii); |
| 100 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, | 100 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, |
| 101 | struct qc_dqblk *di); | 101 | struct qc_dqblk *di); |
| 102 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, | 102 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, |
