fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / vserver / limit_cmd.h
1 #ifndef _VX_LIMIT_CMD_H
2 #define _VX_LIMIT_CMD_H
3
4
5 /*  rlimit vserver commands */
6
7 #define VCMD_get_rlimit         VC_CMD(RLIMIT, 1, 0)
8 #define VCMD_set_rlimit         VC_CMD(RLIMIT, 2, 0)
9 #define VCMD_get_rlimit_mask    VC_CMD(RLIMIT, 3, 0)
10 #define VCMD_reset_minmax       VC_CMD(RLIMIT, 9, 0)
11
12 struct  vcmd_ctx_rlimit_v0 {
13         uint32_t id;
14         uint64_t minimum;
15         uint64_t softlimit;
16         uint64_t maximum;
17 };
18
19 struct  vcmd_ctx_rlimit_mask_v0 {
20         uint32_t minimum;
21         uint32_t softlimit;
22         uint32_t maximum;
23 };
24
25 #define VCMD_rlimit_stat        VC_CMD(VSTAT, 1, 0)
26
27 struct  vcmd_rlimit_stat_v0 {
28         uint32_t id;
29         uint32_t hits;
30         uint64_t value;
31         uint64_t minimum;
32         uint64_t maximum;
33 };
34
35 #define CRLIM_UNSET             (0ULL)
36 #define CRLIM_INFINITY          (~0ULL)
37 #define CRLIM_KEEP              (~1ULL)
38
39 #ifdef  __KERNEL__
40
41 #ifdef  CONFIG_IA32_EMULATION
42
43 struct  vcmd_ctx_rlimit_v0_x32 {
44         uint32_t id;
45         uint64_t minimum;
46         uint64_t softlimit;
47         uint64_t maximum;
48 } __attribute__ ((aligned (4)));
49
50 #endif  /* CONFIG_IA32_EMULATION */
51
52 #include <linux/compiler.h>
53
54 extern int vc_get_rlimit_mask(uint32_t, void __user *);
55 extern int vc_get_rlimit(struct vx_info *, void __user *);
56 extern int vc_set_rlimit(struct vx_info *, void __user *);
57 extern int vc_reset_minmax(struct vx_info *, void __user *);
58
59 extern int vc_rlimit_stat(struct vx_info *, void __user *);
60
61 #ifdef  CONFIG_IA32_EMULATION
62
63 extern int vc_get_rlimit_x32(struct vx_info *, void __user *);
64 extern int vc_set_rlimit_x32(struct vx_info *, void __user *);
65
66 #endif  /* CONFIG_IA32_EMULATION */
67
68 #endif  /* __KERNEL__ */
69 #endif  /* _VX_LIMIT_CMD_H */