kmemcg: account certain kmem allocations to memcg
[deliverable/linux.git] / fs / ecryptfs / main.c
index 4f4d0474bee961e456d015a08f5891b686b9033c..e25b6b06bacf2cf8719d76d06e6efb8a60bd78b8 100644 (file)
@@ -663,6 +663,7 @@ static struct ecryptfs_cache_info {
        struct kmem_cache **cache;
        const char *name;
        size_t size;
+       unsigned long flags;
        void (*ctor)(void *obj);
 } ecryptfs_cache_infos[] = {
        {
@@ -684,6 +685,7 @@ static struct ecryptfs_cache_info {
                .cache = &ecryptfs_inode_info_cache,
                .name = "ecryptfs_inode_cache",
                .size = sizeof(struct ecryptfs_inode_info),
+               .flags = SLAB_ACCOUNT,
                .ctor = inode_info_init_once,
        },
        {
@@ -755,8 +757,8 @@ static int ecryptfs_init_kmem_caches(void)
                struct ecryptfs_cache_info *info;
 
                info = &ecryptfs_cache_infos[i];
-               *(info->cache) = kmem_cache_create(info->name, info->size,
-                               0, SLAB_HWCACHE_ALIGN, info->ctor);
+               *(info->cache) = kmem_cache_create(info->name, info->size, 0,
+                               SLAB_HWCACHE_ALIGN | info->flags, info->ctor);
                if (!*(info->cache)) {
                        ecryptfs_free_kmem_caches();
                        ecryptfs_printk(KERN_WARNING, "%s: "
This page took 0.025079 seconds and 5 git commands to generate.