Skip to content

Commit

Permalink
cifs: pull freeing mountdata/dropping nls/freeing cifs_sb into cifs_u…
Browse files Browse the repository at this point in the history
…mount()

all callers of cifs_umount() proceed to do the same thing; pull it into
cifs_umount() itself.

Acked-by: Pavel Shilovsky <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jun 24, 2011
1 parent 98ab494 commit d757d71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
15 changes: 1 addition & 14 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -725,13 +719,6 @@ cifs_do_mount(struct file_system_type *fs_type,

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;
Expand Down
3 changes: 3 additions & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d757d71

Please sign in to comment.