aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/quota.h28
-rw-r--r--include/linux/quotaops.h4
2 files changed, 14 insertions, 18 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 */
189struct mem_dqblk { 185struct 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 */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index a558a4c1d35a..adcc7ba3accb 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -26,10 +26,10 @@ int dquot_initialize(struct inode *inode, int type);
26int dquot_drop(struct inode *inode); 26int dquot_drop(struct inode *inode);
27 27
28int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); 28int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc);
29int dquot_alloc_inode(const struct inode *inode, unsigned long number); 29int dquot_alloc_inode(const struct inode *inode, qsize_t number);
30 30
31int dquot_free_space(struct inode *inode, qsize_t number); 31int dquot_free_space(struct inode *inode, qsize_t number);
32int dquot_free_inode(const struct inode *inode, unsigned long number); 32int dquot_free_inode(const struct inode *inode, qsize_t number);
33 33
34int dquot_transfer(struct inode *inode, struct iattr *iattr); 34int dquot_transfer(struct inode *inode, struct iattr *iattr);
35int dquot_commit(struct dquot *dquot); 35int dquot_commit(struct dquot *dquot);