Commit dd854466 authored by Al Viro's avatar Al Viro

take bdi setup/destruction into cifs_mount/cifs_umount

Acked-by: default avatarPavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 56299378
...@@ -116,18 +116,12 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info, ...@@ -116,18 +116,12 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
spin_lock_init(&cifs_sb->tlink_tree_lock); spin_lock_init(&cifs_sb->tlink_tree_lock);
cifs_sb->tlink_tree = RB_ROOT; cifs_sb->tlink_tree = RB_ROOT;
rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
if (rc)
return rc;
cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
rc = cifs_mount(sb, cifs_sb, volume_info, devname); rc = cifs_mount(sb, cifs_sb, volume_info, devname);
if (rc) { if (rc) {
if (!silent) if (!silent)
cERROR(1, "cifs_mount failed w/return code = %d", rc); cERROR(1, "cifs_mount failed w/return code = %d", rc);
goto out_mount_failed; return rc;
} }
sb->s_magic = CIFS_MAGIC_NUMBER; sb->s_magic = CIFS_MAGIC_NUMBER;
...@@ -171,9 +165,6 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info, ...@@ -171,9 +165,6 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info,
iput(inode); iput(inode);
cifs_umount(sb, cifs_sb); cifs_umount(sb, cifs_sb);
out_mount_failed:
bdi_destroy(&cifs_sb->bdi);
return rc; return rc;
} }
...@@ -199,7 +190,6 @@ cifs_put_super(struct super_block *sb) ...@@ -199,7 +190,6 @@ cifs_put_super(struct super_block *sb)
} }
unload_nls(cifs_sb->local_nls); unload_nls(cifs_sb->local_nls);
bdi_destroy(&cifs_sb->bdi);
kfree(cifs_sb); kfree(cifs_sb);
} }
......
...@@ -2983,6 +2983,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -2983,6 +2983,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
struct tcon_link *tlink; struct tcon_link *tlink;
#ifdef CONFIG_CIFS_DFS_UPCALL #ifdef CONFIG_CIFS_DFS_UPCALL
int referral_walks_count = 0; int referral_walks_count = 0;
rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
if (rc)
return rc;
cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
try_mount_again: try_mount_again:
/* cleanup activities if we're chasing a referral */ /* cleanup activities if we're chasing a referral */
if (referral_walks_count) { if (referral_walks_count) {
...@@ -3007,6 +3014,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -3007,6 +3014,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
srvTcp = cifs_get_tcp_session(volume_info); srvTcp = cifs_get_tcp_session(volume_info);
if (IS_ERR(srvTcp)) { if (IS_ERR(srvTcp)) {
rc = PTR_ERR(srvTcp); rc = PTR_ERR(srvTcp);
bdi_destroy(&cifs_sb->bdi);
goto out; goto out;
} }
...@@ -3161,6 +3169,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -3161,6 +3169,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
cifs_put_smb_ses(pSesInfo); cifs_put_smb_ses(pSesInfo);
else else
cifs_put_tcp_session(srvTcp); cifs_put_tcp_session(srvTcp);
bdi_destroy(&cifs_sb->bdi);
goto out; goto out;
} }
...@@ -3357,6 +3366,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb) ...@@ -3357,6 +3366,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
} }
spin_unlock(&cifs_sb->tlink_tree_lock); spin_unlock(&cifs_sb->tlink_tree_lock);
bdi_destroy(&cifs_sb->bdi);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment