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