This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / linux / vserver / cacct_def.h
diff --git a/include/linux/vserver/cacct_def.h b/include/linux/vserver/cacct_def.h
new file mode 100644 (file)
index 0000000..a9fd67a
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef _VX_CACCT_DEF_H
+#define _VX_CACCT_DEF_H
+
+#include <asm/atomic.h>
+#include <linux/vserver/cacct.h>
+
+
+struct _vx_sock_acc {
+       atomic_long_t count;
+       atomic_long_t total;
+};
+
+/* context sub struct */
+
+struct _vx_cacct {
+       struct _vx_sock_acc sock[VXA_SOCK_SIZE][3];
+       atomic_t slab[8];
+       atomic_t page[6][8];
+};
+
+#ifdef CONFIG_VSERVER_DEBUG
+
+static inline void __dump_vx_cacct(struct _vx_cacct *cacct)
+{
+       int i,j;
+
+       printk("\t_vx_cacct:");
+       for (i=0; i<6; i++) {
+               struct _vx_sock_acc *ptr = cacct->sock[i];
+
+               printk("\t [%d] =", i);
+               for (j=0; j<3; j++) {
+                       printk(" [%d] = %8lu, %8lu", j,
+                               atomic_long_read(&ptr[j].count),
+                               atomic_long_read(&ptr[j].total));
+               }
+               printk("\n");
+       }
+}
+
+#endif
+
+#endif /* _VX_CACCT_DEF_H */