exofs: Define usercopy region in exofs_inode_cache slab cache
[linux-2.6-block.git] / fs / exofs / super.c
index 819624cfc8da4c7bad401ee26611d69b7ff38f98..e5c532875bb766362d3731ce2987044cc9f5e397 100644 (file)
@@ -192,10 +192,13 @@ static void exofs_init_once(void *foo)
  */
 static int init_inodecache(void)
 {
-       exofs_inode_cachep = kmem_cache_create("exofs_inode_cache",
+       exofs_inode_cachep = kmem_cache_create_usercopy("exofs_inode_cache",
                                sizeof(struct exofs_i_info), 0,
                                SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
-                               SLAB_ACCOUNT, exofs_init_once);
+                               SLAB_ACCOUNT,
+                               offsetof(struct exofs_i_info, i_data),
+                               sizeof_field(struct exofs_i_info, i_data),
+                               exofs_init_once);
        if (exofs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;