fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / vserver / dlimit.h
1 #ifndef _VX_DLIMIT_H
2 #define _VX_DLIMIT_H
3
4 #include "switch.h"
5
6
7 #ifdef  __KERNEL__
8
9 /*      keep in sync with CDLIM_INFINITY        */
10
11 #define DLIM_INFINITY           (~0ULL)
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         tag_t dl_tag;                           /* context tag */
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         unsigned long long dl_space_used;       /* used space in bytes */
29         unsigned long long dl_space_total;      /* maximum space in bytes */
30         unsigned long dl_inodes_used;           /* used inodes */
31         unsigned long 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 *, tag_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 */