This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / mm / slab_vs.h
diff --git a/mm/slab_vs.h b/mm/slab_vs.h
new file mode 100644 (file)
index 0000000..d1d674f
--- /dev/null
@@ -0,0 +1,27 @@
+
+#include <linux/vserver/context.h>
+
+#include <linux/vs_context.h>
+
+static inline
+void vx_slab_alloc(struct kmem_cache *cachep, gfp_t flags)
+{
+       int what = gfp_zone(cachep->gfpflags);
+
+       if (!current->vx_info)
+               return;
+
+       atomic_add(cachep->buffer_size, &current->vx_info->cacct.slab[what]);
+}
+
+static inline
+void vx_slab_free(struct kmem_cache *cachep)
+{
+       int what = gfp_zone(cachep->gfpflags);
+
+       if (!current->vx_info)
+               return;
+
+       atomic_sub(cachep->buffer_size, &current->vx_info->cacct.slab[what]);
+}
+