Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-drm-fsl-dcu.git] / fs / ecryptfs / main.c
index a78d87d14bafb2256313753cc8aeaeeb6c0b381f..fe41ab1566eec58365deda7916d5f5469de014c9 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/pagemap.h>
 #include <linux/key.h>
 #include <linux/parser.h>
+#include <linux/fs_stack.h>
 #include "ecryptfs_kernel.h"
 
 /**
@@ -112,10 +113,10 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
                d_add(dentry, inode);
        else
                d_instantiate(dentry, inode);
-       ecryptfs_copy_attr_all(inode, lower_inode);
+       fsstack_copy_attr_all(inode, lower_inode, NULL);
        /* This size will be overwritten for real files w/ headers and
         * other metadata */
-       ecryptfs_copy_inode_size(inode, lower_inode);
+       fsstack_copy_inode_size(inode, lower_inode);
 out:
        return rc;
 }
@@ -377,15 +378,13 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
 
        /* Released in ecryptfs_put_super() */
        ecryptfs_set_superblock_private(sb,
-                                       kmem_cache_alloc(ecryptfs_sb_info_cache,
-                                                        SLAB_KERNEL));
+                                       kmem_cache_zalloc(ecryptfs_sb_info_cache,
+                                                        GFP_KERNEL));
        if (!ecryptfs_superblock_to_private(sb)) {
                ecryptfs_printk(KERN_WARNING, "Out of memory\n");
                rc = -ENOMEM;
                goto out;
        }
-       memset(ecryptfs_superblock_to_private(sb), 0,
-              sizeof(struct ecryptfs_sb_info));
        sb->s_op = &ecryptfs_sops;
        /* Released through deactivate_super(sb) from get_sb_nodev */
        sb->s_root = d_alloc(NULL, &(const struct qstr) {
@@ -401,16 +400,14 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
        /* Released in d_release when dput(sb->s_root) is called */
        /* through deactivate_super(sb) from get_sb_nodev() */
        ecryptfs_set_dentry_private(sb->s_root,
-                                   kmem_cache_alloc(ecryptfs_dentry_info_cache,
-                                                    SLAB_KERNEL));
+                                   kmem_cache_zalloc(ecryptfs_dentry_info_cache,
+                                                    GFP_KERNEL));
        if (!ecryptfs_dentry_to_private(sb->s_root)) {
                ecryptfs_printk(KERN_ERR,
                                "dentry_info_cache alloc failed\n");
                rc = -ENOMEM;
                goto out;
        }
-       memset(ecryptfs_dentry_to_private(sb->s_root), 0,
-              sizeof(struct ecryptfs_dentry_info));
        rc = 0;
 out:
        /* Should be able to rely on deactivate_super called from
@@ -546,7 +543,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
 }
 
 static struct ecryptfs_cache_info {
-       kmem_cache_t **cache;
+       struct kmem_cache **cache;
        const char *name;
        size_t size;
        void (*ctor)(void*, struct kmem_cache *, unsigned long);
@@ -691,7 +688,7 @@ static ssize_t version_show(struct ecryptfs_obj *obj, char *buff)
 
 static struct ecryptfs_attribute sysfs_attr_version = __ATTR_RO(version);
 
-struct ecryptfs_version_str_map_elem {
+static struct ecryptfs_version_str_map_elem {
        u32 flag;
        char *str;
 } ecryptfs_version_str_map[] = {