aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 09:42:43 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-24 18:39:42 -0400
commitd757d71bfc30669a500b72792067e8d1c5d401a5 (patch)
treefaa2fc95514ad2629d89230d1b13f1c6f865c75e
parent98ab494dd1d25388981114057cf9446250cc7dc7 (diff)
cifs: pull freeing mountdata/dropping nls/freeing cifs_sb into cifs_umount()
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>
-rw-r--r--fs/cifs/cifsfs.c15
-rw-r--r--fs/cifs/connect.c3
2 files changed, 4 insertions, 14 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 15de4561dbc..46960b7ee43 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -171,9 +171,6 @@ static void cifs_kill_sb(struct super_block *sb)
171 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 171 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
172 kill_anon_super(sb); 172 kill_anon_super(sb);
173 cifs_umount(cifs_sb); 173 cifs_umount(cifs_sb);
174 kfree(cifs_sb->mountdata);
175 unload_nls(cifs_sb->local_nls);
176 kfree(cifs_sb);
177} 174}
178 175
179static int 176static int
@@ -685,15 +682,12 @@ cifs_do_mount(struct file_system_type *fs_type,
685 if (IS_ERR(sb)) { 682 if (IS_ERR(sb)) {
686 root = ERR_CAST(sb); 683 root = ERR_CAST(sb);
687 cifs_umount(cifs_sb); 684 cifs_umount(cifs_sb);
688 goto out_cifs_sb; 685 goto out;
689 } 686 }
690 687
691 if (sb->s_fs_info) { 688 if (sb->s_fs_info) {
692 cFYI(1, "Use existing superblock"); 689 cFYI(1, "Use existing superblock");
693 cifs_umount(cifs_sb); 690 cifs_umount(cifs_sb);
694 kfree(cifs_sb->mountdata);
695 unload_nls(cifs_sb->local_nls);
696 kfree(cifs_sb);
697 goto out_shared; 691 goto out_shared;
698 } 692 }
699 693
@@ -725,13 +719,6 @@ out_shared:
725 719
726out_super: 720out_super:
727 deactivate_locked_super(sb); 721 deactivate_locked_super(sb);
728 goto out;
729
730out_cifs_sb:
731 kfree(cifs_sb->mountdata);
732 unload_nls(cifs_sb->local_nls);
733 kfree(cifs_sb);
734
735out: 722out:
736 cifs_cleanup_volume_info(&volume_info); 723 cifs_cleanup_volume_info(&volume_info);
737 return root; 724 return root;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b2702226634..ca7fbe3d51a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3362,6 +3362,9 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
3362 spin_unlock(&cifs_sb->tlink_tree_lock); 3362 spin_unlock(&cifs_sb->tlink_tree_lock);
3363 3363
3364 bdi_destroy(&cifs_sb->bdi); 3364 bdi_destroy(&cifs_sb->bdi);
3365 kfree(cifs_sb->mountdata);
3366 unload_nls(cifs_sb->local_nls);
3367 kfree(cifs_sb);
3365} 3368}
3366 3369
3367int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses) 3370int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses)