summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-17 08:24:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-06-24 18:39:41 -0400
commitdd8544661947ad6d8d87b3c9d4333bfa1583d1bc (patch)
treee1d530ceb7de08402a42034d815492f941bce185 /fs/cifs/connect.c
parent56299378726d5f2ba8d3c8cbbd13cb280ba45e4f (diff)
downloadlinux-dd8544661947ad6d8d87b3c9d4333bfa1583d1bc.tar.gz
linux-dd8544661947ad6d8d87b3c9d4333bfa1583d1bc.tar.bz2
linux-dd8544661947ad6d8d87b3c9d4333bfa1583d1bc.zip
take bdi setup/destruction into cifs_mount/cifs_umount
Acked-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 12cf72dd0c42..78fd7557e35d 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2983,6 +2983,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
struct tcon_link *tlink;
#ifdef CONFIG_CIFS_DFS_UPCALL
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:
/* cleanup activities if we're chasing a referral */
if (referral_walks_count) {
@@ -3007,6 +3014,7 @@ try_mount_again:
srvTcp = cifs_get_tcp_session(volume_info);
if (IS_ERR(srvTcp)) {
rc = PTR_ERR(srvTcp);
+ bdi_destroy(&cifs_sb->bdi);
goto out;
}
@@ -3161,6 +3169,7 @@ mount_fail_check:
cifs_put_smb_ses(pSesInfo);
else
cifs_put_tcp_session(srvTcp);
+ bdi_destroy(&cifs_sb->bdi);
goto out;
}
@@ -3357,6 +3366,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
}
spin_unlock(&cifs_sb->tlink_tree_lock);
+ bdi_destroy(&cifs_sb->bdi);
return 0;
}