cifs: pull freeing mountdata/dropping nls/freeing cifs_sb into cifs_umount()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 17 Jun 2011 13:42:43 +0000 (09:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 24 Jun 2011 22:39:42 +0000 (18:39 -0400)
all callers of cifs_umount() proceed to do the same thing; pull it into
cifs_umount() itself.

Acked-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/cifsfs.c
fs/cifs/connect.c

index 15de4561dbc57e54fb15f33c8d35d80147b39202..46960b7ee433b73bc5434449023cfd1b0eeeb158 100644 (file)
@@ -171,9 +171,6 @@ static void cifs_kill_sb(struct super_block *sb)
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        kill_anon_super(sb);
        cifs_umount(cifs_sb);
-       kfree(cifs_sb->mountdata);
-       unload_nls(cifs_sb->local_nls);
-       kfree(cifs_sb);
 }
 
 static int
@@ -685,15 +682,12 @@ cifs_do_mount(struct file_system_type *fs_type,
        if (IS_ERR(sb)) {
                root = ERR_CAST(sb);
                cifs_umount(cifs_sb);
-               goto out_cifs_sb;
+               goto out;
        }
 
        if (sb->s_fs_info) {
                cFYI(1, "Use existing superblock");
                cifs_umount(cifs_sb);
-               kfree(cifs_sb->mountdata);
-               unload_nls(cifs_sb->local_nls);
-               kfree(cifs_sb);
                goto out_shared;
        }
 
@@ -725,13 +719,6 @@ out_shared:
 
 out_super:
        deactivate_locked_super(sb);
-       goto out;
-
-out_cifs_sb:
-       kfree(cifs_sb->mountdata);
-       unload_nls(cifs_sb->local_nls);
-       kfree(cifs_sb);
-
 out:
        cifs_cleanup_volume_info(&volume_info);
        return root;
index b2702226634e311d7e99872a92db58fe71c64f52..ca7fbe3d51a539cb09fad5e89adc1d31e4bfec09 100644 (file)
@@ -3362,6 +3362,9 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
        spin_unlock(&cifs_sb->tlink_tree_lock);
 
        bdi_destroy(&cifs_sb->bdi);
+       kfree(cifs_sb->mountdata);
+       unload_nls(cifs_sb->local_nls);
+       kfree(cifs_sb);
 }
 
 int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses)