fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / vserver / dlimit_cmd.h
1 #ifndef _VX_DLIMIT_CMD_H
2 #define _VX_DLIMIT_CMD_H
3
4
5 /*  dlimit vserver commands */
6
7 #define VCMD_add_dlimit         VC_CMD(DLIMIT, 1, 0)
8 #define VCMD_rem_dlimit         VC_CMD(DLIMIT, 2, 0)
9
10 #define VCMD_set_dlimit         VC_CMD(DLIMIT, 5, 0)
11 #define VCMD_get_dlimit         VC_CMD(DLIMIT, 6, 0)
12
13 struct  vcmd_ctx_dlimit_base_v0 {
14         const char __user *name;
15         uint32_t flags;
16 };
17
18 struct  vcmd_ctx_dlimit_v0 {
19         const char __user *name;
20         uint32_t space_used;                    /* used space in kbytes */
21         uint32_t space_total;                   /* maximum space in kbytes */
22         uint32_t inodes_used;                   /* used inodes */
23         uint32_t inodes_total;                  /* maximum inodes */
24         uint32_t reserved;                      /* reserved for root in % */
25         uint32_t flags;
26 };
27
28 #define CDLIM_UNSET             ((uint32_t)0UL)
29 #define CDLIM_INFINITY          ((uint32_t)~0UL)
30 #define CDLIM_KEEP              ((uint32_t)~1UL)
31
32 #ifdef  __KERNEL__
33
34 #ifdef  CONFIG_COMPAT
35
36 #include <asm/compat.h>
37
38 struct  vcmd_ctx_dlimit_base_v0_x32 {
39         compat_uptr_t name_ptr;
40         uint32_t flags;
41 };
42
43 struct  vcmd_ctx_dlimit_v0_x32 {
44         compat_uptr_t name_ptr;
45         uint32_t space_used;                    /* used space in kbytes */
46         uint32_t space_total;                   /* maximum space in kbytes */
47         uint32_t inodes_used;                   /* used inodes */
48         uint32_t inodes_total;                  /* maximum inodes */
49         uint32_t reserved;                      /* reserved for root in % */
50         uint32_t flags;
51 };
52
53 #endif  /* CONFIG_COMPAT */
54
55 #include <linux/compiler.h>
56
57 extern int vc_add_dlimit(uint32_t, void __user *);
58 extern int vc_rem_dlimit(uint32_t, void __user *);
59
60 extern int vc_set_dlimit(uint32_t, void __user *);
61 extern int vc_get_dlimit(uint32_t, void __user *);
62
63 #ifdef  CONFIG_COMPAT
64
65 extern int vc_add_dlimit_x32(uint32_t, void __user *);
66 extern int vc_rem_dlimit_x32(uint32_t, void __user *);
67
68 extern int vc_set_dlimit_x32(uint32_t, void __user *);
69 extern int vc_get_dlimit_x32(uint32_t, void __user *);
70
71 #endif  /* CONFIG_COMPAT */
72
73 #endif  /* __KERNEL__ */
74 #endif  /* _VX_DLIMIT_CMD_H */