sanitize cifs_umount() prototype
[pandora-kernel.git] / fs / cifs / cifsfs.c
index dc76c7b..2af14d4 100644 (file)
@@ -113,10 +113,7 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
 
        cifs_sb = CIFS_SB(sb);
 
-       spin_lock_init(&cifs_sb->tlink_tree_lock);
-       cifs_sb->tlink_tree = RB_ROOT;
-
-       rc = cifs_mount(sb, cifs_sb, volume_info, devname);
+       rc = cifs_mount(cifs_sb, volume_info);
 
        if (rc) {
                if (!silent)
@@ -124,6 +121,17 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
                return rc;
        }
 
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL)
+               sb->s_flags |= MS_POSIXACL;
+
+       if (cifs_sb_master_tcon(cifs_sb)->ses->capabilities & CAP_LARGE_FILES)
+               sb->s_maxbytes = MAX_LFS_FILESIZE;
+       else
+               sb->s_maxbytes = MAX_NON_LFS;
+
+       /* BB FIXME fix time_gran to be larger for LANMAN sessions */
+       sb->s_time_gran = 100;
+
        sb->s_magic = CIFS_MAGIC_NUMBER;
        sb->s_op = &cifs_super_ops;
        sb->s_bdi = &cifs_sb->bdi;
@@ -164,7 +172,7 @@ out_no_root:
        if (inode)
                iput(inode);
 
-       cifs_umount(sb, cifs_sb);
+       cifs_umount(cifs_sb);
        return rc;
 }
 
@@ -181,9 +189,7 @@ cifs_put_super(struct super_block *sb)
                return;
        }
 
-       rc = cifs_umount(sb, cifs_sb);
-       if (rc)
-               cERROR(1, "cifs_umount failed with return code %d", rc);
+       cifs_umount(cifs_sb);
 }
 
 static void cifs_kill_sb(struct super_block *sb)
@@ -672,6 +678,15 @@ cifs_do_mount(struct file_system_type *fs_type,
        cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
        if (cifs_sb == NULL) {
                root = ERR_PTR(-ENOMEM);
+               unload_nls(volume_info->local_nls);
+               goto out;
+       }
+
+       cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
+       if (cifs_sb->mountdata == NULL) {
+               root = ERR_PTR(-ENOMEM);
+               unload_nls(volume_info->local_nls);
+               kfree(cifs_sb);
                goto out;
        }
 
@@ -689,20 +704,12 @@ cifs_do_mount(struct file_system_type *fs_type,
 
        if (sb->s_fs_info) {
                cFYI(1, "Use existing superblock");
+               kfree(cifs_sb->mountdata);
+               unload_nls(cifs_sb->local_nls);
+               kfree(cifs_sb);
                goto out_shared;
        }
 
-       /*
-        * Copy mount params for use in submounts. Better to do
-        * the copy here and deal with the error before cleanup gets
-        * complicated post-mount.
-        */
-       cifs_sb->mountdata = kstrndup(data, PAGE_SIZE, GFP_KERNEL);
-       if (cifs_sb->mountdata == NULL) {
-               root = ERR_PTR(-ENOMEM);
-               goto out_super;
-       }
-
        sb->s_flags = flags;
        /* BB should we make this contingent on mount parm? */
        sb->s_flags |= MS_NODIRATIME | MS_NOATIME;
@@ -735,6 +742,7 @@ out_super:
        goto out;
 
 out_cifs_sb:
+       kfree(cifs_sb->mountdata);
        unload_nls(cifs_sb->local_nls);
        kfree(cifs_sb);