updated to headers from patch-2.6.11.7-vs2.0-pre2
[util-vserver.git] / util-vserver / kernel / dlimit.h
1 #ifndef _VX_DLIMIT_H
2 #define _VX_DLIMIT_H
3
4 #include "switch.h"
5 #include <linux/spinlock.h>
6
7 #define CDLIM_UNSET             (0ULL)
8 #define CDLIM_INFINITY          (~0ULL)
9 #define CDLIM_KEEP              (~1ULL)
10
11
12 #ifdef  __KERNEL__
13
14 struct super_block;
15
16 struct dl_info {
17         struct hlist_node dl_hlist;             /* linked list of contexts */
18         struct rcu_head dl_rcu;                 /* the rcu head */
19         xid_t dl_xid;                           /* context id */
20         atomic_t dl_usecnt;                     /* usage count */
21         atomic_t dl_refcnt;                     /* reference count */
22
23         struct super_block *dl_sb;              /* associated superblock */
24
25         spinlock_t dl_lock;                     /* protect the values */
26
27         uint64_t dl_space_used;                 /* used space in bytes */
28         uint64_t dl_space_total;                /* maximum space in bytes */
29         uint32_t dl_inodes_used;                /* used inodes */
30         uint32_t dl_inodes_total;               /* maximum inodes */
31
32         unsigned int dl_nrlmult;                /* non root limit mult */
33 };
34
35 struct rcu_head;
36
37 extern void rcu_free_dl_info(struct rcu_head *);
38 extern void unhash_dl_info(struct dl_info *);
39
40 extern struct dl_info *locate_dl_info(struct super_block *, xid_t);
41
42
43 struct kstatfs;
44
45 extern void vx_vsi_statfs(struct super_block *, struct kstatfs *);
46
47 typedef uint64_t dlsize_t;
48
49 #endif  /* __KERNEL__ */
50 #else   /* _VX_DLIMIT_H */
51 #warning duplicate inclusion
52 #endif  /* _VX_DLIMIT_H */