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.h33
1 files changed, 8 insertions, 25 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index a6861f117480..b462916b2a0a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -279,9 +279,6 @@ struct dquot {
279 struct mem_dqblk dq_dqb; /* Diskquota usage */ 279 struct mem_dqblk dq_dqb; /* Diskquota usage */
280}; 280};
281 281
282#define QUOTA_OK 0
283#define NO_QUOTA 1
284
285/* Operations which must be implemented by each quota format */ 282/* Operations which must be implemented by each quota format */
286struct quota_format_ops { 283struct quota_format_ops {
287 int (*check_quota_file)(struct super_block *sb, int type); /* Detect whether file is in our format */ 284 int (*check_quota_file)(struct super_block *sb, int type); /* Detect whether file is in our format */
@@ -295,13 +292,6 @@ struct quota_format_ops {
295 292
296/* Operations working with dquots */ 293/* Operations working with dquots */
297struct dquot_operations { 294struct dquot_operations {
298 int (*initialize) (struct inode *, int);
299 int (*drop) (struct inode *);
300 int (*alloc_space) (struct inode *, qsize_t, int);
301 int (*alloc_inode) (const struct inode *, qsize_t);
302 int (*free_space) (struct inode *, qsize_t);
303 int (*free_inode) (const struct inode *, qsize_t);
304 int (*transfer) (struct inode *, struct iattr *);
305 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ 295 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */
306 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ 296 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */
307 void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */ 297 void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */
@@ -309,12 +299,6 @@ struct dquot_operations {
309 int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ 299 int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */
310 int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ 300 int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */
311 int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */ 301 int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */
312 /* reserve quota for delayed block allocation */
313 int (*reserve_space) (struct inode *, qsize_t, int);
314 /* claim reserved quota for delayed alloc */
315 int (*claim_space) (struct inode *, qsize_t);
316 /* release rsved quota for delayed alloc */
317 void (*release_rsv) (struct inode *, qsize_t);
318 /* get reserved quota for delayed alloc, value returned is managed by 302 /* get reserved quota for delayed alloc, value returned is managed by
319 * quota code only */ 303 * quota code only */
320 qsize_t *(*get_reserved_space) (struct inode *); 304 qsize_t *(*get_reserved_space) (struct inode *);
@@ -324,7 +308,7 @@ struct dquot_operations {
324struct quotactl_ops { 308struct quotactl_ops {
325 int (*quota_on)(struct super_block *, int, int, char *, int); 309 int (*quota_on)(struct super_block *, int, int, char *, int);
326 int (*quota_off)(struct super_block *, int, int); 310 int (*quota_off)(struct super_block *, int, int);
327 int (*quota_sync)(struct super_block *, int); 311 int (*quota_sync)(struct super_block *, int, int);
328 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 312 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
329 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 313 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
330 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 314 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *);
@@ -357,26 +341,25 @@ enum {
357#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ 341#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \
358 DQUOT_SUSPENDED) 342 DQUOT_SUSPENDED)
359/* Other quota flags */ 343/* Other quota flags */
360#define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special 344#define DQUOT_STATE_LAST (_DQUOT_STATE_FLAGS * MAXQUOTAS)
345#define DQUOT_QUOTA_SYS_FILE (1 << DQUOT_STATE_LAST)
346 /* Quota file is a special
361 * system file and user cannot 347 * system file and user cannot
362 * touch it. Filesystem is 348 * touch it. Filesystem is
363 * responsible for setting 349 * responsible for setting
364 * S_NOQUOTA, S_NOATIME flags 350 * S_NOQUOTA, S_NOATIME flags
365 */ 351 */
366#define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ 352#define DQUOT_NEGATIVE_USAGE (1 << (DQUOT_STATE_LAST + 1))
353 /* Allow negative quota usage */
367 354
368static inline unsigned int dquot_state_flag(unsigned int flags, int type) 355static inline unsigned int dquot_state_flag(unsigned int flags, int type)
369{ 356{
370 if (type == USRQUOTA) 357 return flags << _DQUOT_STATE_FLAGS * type;
371 return flags;
372 return flags << _DQUOT_STATE_FLAGS;
373} 358}
374 359
375static inline unsigned int dquot_generic_flag(unsigned int flags, int type) 360static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
376{ 361{
377 if (type == USRQUOTA) 362 return (flags >> _DQUOT_STATE_FLAGS * type) & DQUOT_STATE_FLAGS;
378 return flags;
379 return flags >> _DQUOT_STATE_FLAGS;
380} 363}
381 364
382#ifdef CONFIG_QUOTA_NETLINK_INTERFACE 365#ifdef CONFIG_QUOTA_NETLINK_INTERFACE