5 #include <linux/spinlock.h>
7 /* inode vserver commands */
9 #define VCMD_add_dlimit VC_CMD(DLIMIT, 1, 0)
10 #define VCMD_rem_dlimit VC_CMD(DLIMIT, 2, 0)
12 #define VCMD_set_dlimit VC_CMD(DLIMIT, 5, 0)
13 #define VCMD_get_dlimit VC_CMD(DLIMIT, 6, 0)
16 struct vcmd_ctx_dlimit_base_v0 {
17 const char __user *name;
21 struct vcmd_ctx_dlimit_v0 {
22 const char __user *name;
23 uint32_t space_used; /* used space in kbytes */
24 uint32_t space_total; /* maximum space in kbytes */
25 uint32_t inodes_used; /* used inodes */
26 uint32_t inodes_total; /* maximum inodes */
27 uint32_t reserved; /* reserved for root in % */
31 #define CDLIM_UNSET (0ULL)
32 #define CDLIM_INFINITY (~0ULL)
33 #define CDLIM_KEEP (~1ULL)
41 struct hlist_node dl_hlist; /* linked list of contexts */
42 struct rcu_head dl_rcu; /* the rcu head */
43 xid_t dl_xid; /* context id */
44 atomic_t dl_usecnt; /* usage count */
45 atomic_t dl_refcnt; /* reference count */
47 struct super_block *dl_sb; /* associated superblock */
49 // struct rw_semaphore dl_sem; /* protect the values */
50 spinlock_t dl_lock; /* protect the values */
52 uint64_t dl_space_used; /* used space in bytes */
53 uint64_t dl_space_total; /* maximum space in bytes */
54 uint32_t dl_inodes_used; /* used inodes */
55 uint32_t dl_inodes_total; /* maximum inodes */
57 unsigned int dl_nrlmult; /* non root limit mult */
62 extern void rcu_free_dl_info(struct rcu_head *);
63 extern void unhash_dl_info(struct dl_info *);
65 extern struct dl_info *locate_dl_info(struct super_block *, xid_t);
70 extern void vx_vsi_statfs(struct super_block *, struct kstatfs *);
73 extern int vc_add_dlimit(uint32_t, void __user *);
74 extern int vc_rem_dlimit(uint32_t, void __user *);
76 extern int vc_set_dlimit(uint32_t, void __user *);
77 extern int vc_get_dlimit(uint32_t, void __user *);
80 typedef uint64_t dlsize_t;
83 #endif /* __KERNEL__ */
85 #endif /* _VX_DLIMIT_H */