1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _LINUX_QUOTA_
13 #define _LINUX_QUOTA_
14 
15 #include <linux/errno.h>
16 #include <linux/types.h>
17 
18 #define __DQUOT_VERSION__ "dquot_6.5.1"
19 #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
20 
21 typedef __kernel_uid32_t qid_t;
22 typedef __u64 qsize_t;
23 
24 #define QUOTABLOCK_BITS 10
25 #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
26 
27 #define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10))
28 #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
29 #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
30 
31 #define MAXQUOTAS 2
32 #define USRQUOTA 0
33 #define GRPQUOTA 1
34 
35 #define INITQFNAMES {   "user",     "group",     "undefined",  };
36 
37 #define SUBCMDMASK 0x00ff
38 #define SUBCMDSHIFT 8
39 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
40 
41 #define Q_SYNC 0x800001
42 #define Q_QUOTAON 0x800002
43 #define Q_QUOTAOFF 0x800003
44 #define Q_GETFMT 0x800004
45 #define Q_GETINFO 0x800005
46 #define Q_SETINFO 0x800006
47 #define Q_GETQUOTA 0x800007
48 #define Q_SETQUOTA 0x800008
49 
50 #define QIF_BLIMITS 1
51 #define QIF_SPACE 2
52 #define QIF_ILIMITS 4
53 #define QIF_INODES 8
54 #define QIF_BTIME 16
55 #define QIF_ITIME 32
56 #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
57 #define QIF_USAGE (QIF_SPACE | QIF_INODES)
58 #define QIF_TIMES (QIF_BTIME | QIF_ITIME)
59 #define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
60 
61 struct if_dqblk {
62  __u64 dqb_bhardlimit;
63  __u64 dqb_bsoftlimit;
64  __u64 dqb_curspace;
65  __u64 dqb_ihardlimit;
66  __u64 dqb_isoftlimit;
67  __u64 dqb_curinodes;
68  __u64 dqb_btime;
69  __u64 dqb_itime;
70  __u32 dqb_valid;
71 };
72 
73 #define IIF_BGRACE 1
74 #define IIF_IGRACE 2
75 #define IIF_FLAGS 4
76 #define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
77 
78 struct if_dqinfo {
79  __u64 dqi_bgrace;
80  __u64 dqi_igrace;
81  __u32 dqi_flags;
82  __u32 dqi_valid;
83 };
84 
85 #include <sys/cdefs.h>
86 
87 #endif
88