diff options
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r-- | include/linux/quota.h | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index 3ce708c2cb3c..9ea468363f9f 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -39,15 +39,6 @@ | |||
39 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 39 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
40 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 40 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
41 | 41 | ||
42 | /* Size of blocks in which are counted size limits */ | ||
43 | #define QUOTABLOCK_BITS 10 | ||
44 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) | ||
45 | |||
46 | /* Conversion routines from and to quota blocks */ | ||
47 | #define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10)) | ||
48 | #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) | ||
49 | #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) | ||
50 | |||
51 | #define MAXQUOTAS 2 | 42 | #define MAXQUOTAS 2 |
52 | #define USRQUOTA 0 /* element used for user quotas */ | 43 | #define USRQUOTA 0 /* element used for user quotas */ |
53 | #define GRPQUOTA 1 /* element used for group quotas */ | 44 | #define GRPQUOTA 1 /* element used for group quotas */ |
@@ -80,6 +71,11 @@ | |||
80 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ | 71 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ |
81 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ | 72 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ |
82 | 73 | ||
74 | /* Size of block in which space limits are passed through the quota | ||
75 | * interface */ | ||
76 | #define QIF_DQBLKSIZE_BITS 10 | ||
77 | #define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS) | ||
78 | |||
83 | /* | 79 | /* |
84 | * Quota structure used for communication with userspace via quotactl | 80 | * Quota structure used for communication with userspace via quotactl |
85 | * Following flags are used to specify which fields are valid | 81 | * Following flags are used to specify which fields are valid |
@@ -187,12 +183,12 @@ extern spinlock_t dq_data_lock; | |||
187 | * Data for one user/group kept in memory | 183 | * Data for one user/group kept in memory |
188 | */ | 184 | */ |
189 | struct mem_dqblk { | 185 | struct mem_dqblk { |
190 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | 186 | qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ |
191 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | 187 | qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ |
192 | qsize_t dqb_curspace; /* current used space */ | 188 | qsize_t dqb_curspace; /* current used space */ |
193 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | 189 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ |
194 | __u32 dqb_isoftlimit; /* preferred inode limit */ | 190 | qsize_t dqb_isoftlimit; /* preferred inode limit */ |
195 | __u32 dqb_curinodes; /* current # allocated inodes */ | 191 | qsize_t dqb_curinodes; /* current # allocated inodes */ |
196 | time_t dqb_btime; /* time limit for excessive disk use */ | 192 | time_t dqb_btime; /* time limit for excessive disk use */ |
197 | time_t dqb_itime; /* time limit for excessive inode use */ | 193 | time_t dqb_itime; /* time limit for excessive inode use */ |
198 | }; | 194 | }; |
@@ -287,9 +283,9 @@ struct dquot_operations { | |||
287 | int (*initialize) (struct inode *, int); | 283 | int (*initialize) (struct inode *, int); |
288 | int (*drop) (struct inode *); | 284 | int (*drop) (struct inode *); |
289 | int (*alloc_space) (struct inode *, qsize_t, int); | 285 | int (*alloc_space) (struct inode *, qsize_t, int); |
290 | int (*alloc_inode) (const struct inode *, unsigned long); | 286 | int (*alloc_inode) (const struct inode *, qsize_t); |
291 | int (*free_space) (struct inode *, qsize_t); | 287 | int (*free_space) (struct inode *, qsize_t); |
292 | int (*free_inode) (const struct inode *, unsigned long); | 288 | int (*free_inode) (const struct inode *, qsize_t); |
293 | int (*transfer) (struct inode *, struct iattr *); | 289 | int (*transfer) (struct inode *, struct iattr *); |
294 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ | 290 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ |
295 | struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ | 291 | struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ |