Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[powerpc.git] / fs / ecryptfs / main.c
index 97e6801..e5580bc 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/crypto.h>
 #include <linux/netlink.h>
 #include <linux/mount.h>
-#include <linux/dcache.h>
 #include <linux/pagemap.h>
 #include <linux/key.h>
 #include <linux/parser.h>
@@ -139,11 +138,14 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
                inode_info->lower_file = dentry_open(lower_dentry,
                                                     lower_mnt,
                                                     (O_RDWR | O_LARGEFILE));
-               if (IS_ERR(inode_info->lower_file))
+               if (IS_ERR(inode_info->lower_file)) {
+                       dget(lower_dentry);
+                       mntget(lower_mnt);
                        inode_info->lower_file = dentry_open(lower_dentry,
                                                             lower_mnt,
                                                             (O_RDONLY
                                                              | O_LARGEFILE));
+               }
                if (IS_ERR(inode_info->lower_file)) {
                        printk(KERN_ERR "Error opening lower persistent file "
                               "for lower_dentry [0x%p] and lower_mnt [0x%p]\n",
@@ -524,6 +526,7 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
        lower_mnt = nd.mnt;
        ecryptfs_set_superblock_lower(sb, lower_root->d_sb);
        sb->s_maxbytes = lower_root->d_sb->s_maxbytes;
+       sb->s_blocksize = lower_root->d_sb->s_blocksize;
        ecryptfs_set_dentry_lower(sb->s_root, lower_root);
        ecryptfs_set_dentry_lower_mnt(sb->s_root, lower_mnt);
        rc = ecryptfs_interpose(lower_root, sb->s_root, sb, 0);
@@ -611,7 +614,7 @@ static struct file_system_type ecryptfs_fs_type = {
  * Initializes the ecryptfs_inode_info_cache when it is created
  */
 static void
-inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
+inode_info_init_once(struct kmem_cache *cachep, void *vptr)
 {
        struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
 
@@ -622,7 +625,7 @@ static struct ecryptfs_cache_info {
        struct kmem_cache **cache;
        const char *name;
        size_t size;
-       void (*ctor)(void*, struct kmem_cache *, unsigned long);
+       void (*ctor)(struct kmem_cache *cache, void *obj);
 } ecryptfs_cache_infos[] = {
        {
                .cache = &ecryptfs_auth_tok_list_item_cache,