This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / linux / vserver / cacct_def.h
1 #ifndef _VX_CACCT_DEF_H
2 #define _VX_CACCT_DEF_H
3
4 #include <asm/atomic.h>
5 #include <linux/vserver/cacct.h>
6
7
8 struct _vx_sock_acc {
9         atomic_long_t count;
10         atomic_long_t total;
11 };
12
13 /* context sub struct */
14
15 struct _vx_cacct {
16         struct _vx_sock_acc sock[VXA_SOCK_SIZE][3];
17         atomic_t slab[8];
18         atomic_t page[6][8];
19 };
20
21 #ifdef CONFIG_VSERVER_DEBUG
22
23 static inline void __dump_vx_cacct(struct _vx_cacct *cacct)
24 {
25         int i,j;
26
27         printk("\t_vx_cacct:");
28         for (i=0; i<6; i++) {
29                 struct _vx_sock_acc *ptr = cacct->sock[i];
30
31                 printk("\t [%d] =", i);
32                 for (j=0; j<3; j++) {
33                         printk(" [%d] = %8lu, %8lu", j,
34                                 atomic_long_read(&ptr[j].count),
35                                 atomic_long_read(&ptr[j].total));
36                 }
37                 printk("\n");
38         }
39 }
40
41 #endif
42
43 #endif  /* _VX_CACCT_DEF_H */