diff options
Diffstat (limited to 'include/linux/quota.h')
| -rw-r--r-- | include/linux/quota.h | 69 |
1 files changed, 57 insertions, 12 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index 50978b781a19..d534e8ed308a 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -216,19 +216,21 @@ struct mem_dqinfo { | |||
| 216 | unsigned long dqi_flags; | 216 | unsigned long dqi_flags; |
| 217 | unsigned int dqi_bgrace; | 217 | unsigned int dqi_bgrace; |
| 218 | unsigned int dqi_igrace; | 218 | unsigned int dqi_igrace; |
| 219 | qsize_t dqi_maxblimit; | 219 | qsize_t dqi_max_spc_limit; |
| 220 | qsize_t dqi_maxilimit; | 220 | qsize_t dqi_max_ino_limit; |
| 221 | void *dqi_priv; | 221 | void *dqi_priv; |
| 222 | }; | 222 | }; |
| 223 | 223 | ||
| 224 | struct super_block; | 224 | struct super_block; |
| 225 | 225 | ||
| 226 | #define DQF_MASK 0xffff /* Mask for format specific flags */ | 226 | /* Mask for flags passed to userspace */ |
| 227 | #define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */ | 227 | #define DQF_GETINFO_MASK (DQF_ROOT_SQUASH | DQF_SYS_FILE) |
| 228 | #define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */ | 228 | /* Mask for flags modifiable from userspace */ |
| 229 | #define DQF_SYS_FILE_B 16 | 229 | #define DQF_SETINFO_MASK DQF_ROOT_SQUASH |
| 230 | #define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */ | 230 | |
| 231 | #define DQF_INFO_DIRTY_B 31 | 231 | enum { |
| 232 | DQF_INFO_DIRTY_B = DQF_PRIVATE, | ||
| 233 | }; | ||
| 232 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ | 234 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ |
| 233 | 235 | ||
| 234 | extern void mark_info_dirty(struct super_block *sb, int type); | 236 | extern void mark_info_dirty(struct super_block *sb, int type); |
| @@ -321,18 +323,61 @@ struct dquot_operations { | |||
| 321 | 323 | ||
| 322 | struct path; | 324 | struct path; |
| 323 | 325 | ||
| 326 | /* Structure for communicating via ->get_dqblk() & ->set_dqblk() */ | ||
| 327 | struct qc_dqblk { | ||
| 328 | int d_fieldmask; /* mask of fields to change in ->set_dqblk() */ | ||
| 329 | u64 d_spc_hardlimit; /* absolute limit on used space */ | ||
| 330 | u64 d_spc_softlimit; /* preferred limit on used space */ | ||
| 331 | u64 d_ino_hardlimit; /* maximum # allocated inodes */ | ||
| 332 | u64 d_ino_softlimit; /* preferred inode limit */ | ||
| 333 | u64 d_space; /* Space owned by the user */ | ||
| 334 | u64 d_ino_count; /* # inodes owned by the user */ | ||
| 335 | s64 d_ino_timer; /* zero if within inode limits */ | ||
| 336 | /* if not, we refuse service */ | ||
| 337 | s64 d_spc_timer; /* similar to above; for space */ | ||
| 338 | int d_ino_warns; /* # warnings issued wrt num inodes */ | ||
| 339 | int d_spc_warns; /* # warnings issued wrt used space */ | ||
| 340 | u64 d_rt_spc_hardlimit; /* absolute limit on realtime space */ | ||
| 341 | u64 d_rt_spc_softlimit; /* preferred limit on RT space */ | ||
| 342 | u64 d_rt_space; /* realtime space owned */ | ||
| 343 | s64 d_rt_spc_timer; /* similar to above; for RT space */ | ||
| 344 | int d_rt_spc_warns; /* # warnings issued wrt RT space */ | ||
| 345 | }; | ||
| 346 | |||
| 347 | /* Field specifiers for ->set_dqblk() in struct qc_dqblk */ | ||
| 348 | #define QC_INO_SOFT (1<<0) | ||
| 349 | #define QC_INO_HARD (1<<1) | ||
| 350 | #define QC_SPC_SOFT (1<<2) | ||
| 351 | #define QC_SPC_HARD (1<<3) | ||
| 352 | #define QC_RT_SPC_SOFT (1<<4) | ||
| 353 | #define QC_RT_SPC_HARD (1<<5) | ||
| 354 | #define QC_LIMIT_MASK (QC_INO_SOFT | QC_INO_HARD | QC_SPC_SOFT | QC_SPC_HARD | \ | ||
| 355 | QC_RT_SPC_SOFT | QC_RT_SPC_HARD) | ||
| 356 | #define QC_SPC_TIMER (1<<6) | ||
| 357 | #define QC_INO_TIMER (1<<7) | ||
| 358 | #define QC_RT_SPC_TIMER (1<<8) | ||
| 359 | #define QC_TIMER_MASK (QC_SPC_TIMER | QC_INO_TIMER | QC_RT_SPC_TIMER) | ||
| 360 | #define QC_SPC_WARNS (1<<9) | ||
| 361 | #define QC_INO_WARNS (1<<10) | ||
| 362 | #define QC_RT_SPC_WARNS (1<<11) | ||
| 363 | #define QC_WARNS_MASK (QC_SPC_WARNS | QC_INO_WARNS | QC_RT_SPC_WARNS) | ||
| 364 | #define QC_SPACE (1<<12) | ||
| 365 | #define QC_INO_COUNT (1<<13) | ||
| 366 | #define QC_RT_SPACE (1<<14) | ||
| 367 | #define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) | ||
| 368 | |||
| 324 | /* Operations handling requests from userspace */ | 369 | /* Operations handling requests from userspace */ |
| 325 | struct quotactl_ops { | 370 | struct quotactl_ops { |
| 326 | int (*quota_on)(struct super_block *, int, int, struct path *); | 371 | int (*quota_on)(struct super_block *, int, int, struct path *); |
| 327 | int (*quota_on_meta)(struct super_block *, int, int); | ||
| 328 | int (*quota_off)(struct super_block *, int); | 372 | int (*quota_off)(struct super_block *, int); |
| 373 | int (*quota_enable)(struct super_block *, unsigned int); | ||
| 374 | int (*quota_disable)(struct super_block *, unsigned int); | ||
| 329 | int (*quota_sync)(struct super_block *, int); | 375 | int (*quota_sync)(struct super_block *, int); |
| 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 376 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
| 331 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 377 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
| 332 | int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); | 378 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 333 | int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); | 379 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 334 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 380 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); |
| 335 | int (*set_xstate)(struct super_block *, unsigned int, int); | ||
| 336 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); | 381 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); |
| 337 | int (*rm_xquota)(struct super_block *, unsigned int); | 382 | int (*rm_xquota)(struct super_block *, unsigned int); |
| 338 | }; | 383 | }; |
