diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-17 08:24:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-24 18:39:41 -0400 |
commit | dd8544661947ad6d8d87b3c9d4333bfa1583d1bc (patch) | |
tree | e1d530ceb7de08402a42034d815492f941bce185 /fs | |
parent | 56299378726d5f2ba8d3c8cbbd13cb280ba45e4f (diff) |
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')
-rw-r--r-- | fs/cifs/cifsfs.c | 12 | ||||
-rw-r--r-- | fs/cifs/connect.c | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 2f0c58646c10..5d3c4fa4b546 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -116,18 +116,12 @@ cifs_read_super(struct super_block *sb, struct smb_vol *volume_info, | |||
116 | spin_lock_init(&cifs_sb->tlink_tree_lock); | 116 | spin_lock_init(&cifs_sb->tlink_tree_lock); |
117 | cifs_sb->tlink_tree = RB_ROOT; | 117 | cifs_sb->tlink_tree = RB_ROOT; |
118 | 118 | ||
119 | rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY); | ||
120 | if (rc) | ||
121 | return rc; | ||
122 | |||
123 | cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; | ||
124 | |||
125 | rc = cifs_mount(sb, cifs_sb, volume_info, devname); | 119 | rc = cifs_mount(sb, cifs_sb, volume_info, devname); |
126 | 120 | ||
127 | if (rc) { | 121 | if (rc) { |
128 | if (!silent) | 122 | if (!silent) |
129 | cERROR(1, "cifs_mount failed w/return code = %d", rc); | 123 | cERROR(1, "cifs_mount failed w/return code = %d", rc); |
130 | goto out_mount_failed; | 124 | return rc; |
131 | } | 125 | } |
132 | 126 | ||
133 | sb->s_magic = CIFS_MAGIC_NUMBER; | 127 | sb->s_magic = CIFS_MAGIC_NUMBER; |
@@ -171,9 +165,6 @@ out_no_root: | |||
171 | iput(inode); | 165 | iput(inode); |
172 | 166 | ||
173 | cifs_umount(sb, cifs_sb); | 167 | cifs_umount(sb, cifs_sb); |
174 | |||
175 | out_mount_failed: | ||
176 | bdi_destroy(&cifs_sb->bdi); | ||
177 | return rc; | 168 | return rc; |
178 | } | 169 | } |
179 | 170 | ||
@@ -199,7 +190,6 @@ cifs_put_super(struct super_block *sb) | |||
199 | } | 190 | } |
200 | 191 | ||
201 | unload_nls(cifs_sb->local_nls); | 192 | unload_nls(cifs_sb->local_nls); |
202 | bdi_destroy(&cifs_sb->bdi); | ||
203 | kfree(cifs_sb); | 193 | kfree(cifs_sb); |
204 | } | 194 | } |
205 | 195 | ||
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, | |||
2983 | struct tcon_link *tlink; | 2983 | struct tcon_link *tlink; |
2984 | #ifdef CONFIG_CIFS_DFS_UPCALL | 2984 | #ifdef CONFIG_CIFS_DFS_UPCALL |
2985 | int referral_walks_count = 0; | 2985 | int referral_walks_count = 0; |
2986 | |||
2987 | rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY); | ||
2988 | if (rc) | ||
2989 | return rc; | ||
2990 | |||
2991 | cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages; | ||
2992 | |||
2986 | try_mount_again: | 2993 | try_mount_again: |
2987 | /* cleanup activities if we're chasing a referral */ | 2994 | /* cleanup activities if we're chasing a referral */ |
2988 | if (referral_walks_count) { | 2995 | if (referral_walks_count) { |
@@ -3007,6 +3014,7 @@ try_mount_again: | |||
3007 | srvTcp = cifs_get_tcp_session(volume_info); | 3014 | srvTcp = cifs_get_tcp_session(volume_info); |
3008 | if (IS_ERR(srvTcp)) { | 3015 | if (IS_ERR(srvTcp)) { |
3009 | rc = PTR_ERR(srvTcp); | 3016 | rc = PTR_ERR(srvTcp); |
3017 | bdi_destroy(&cifs_sb->bdi); | ||
3010 | goto out; | 3018 | goto out; |
3011 | } | 3019 | } |
3012 | 3020 | ||
@@ -3161,6 +3169,7 @@ mount_fail_check: | |||
3161 | cifs_put_smb_ses(pSesInfo); | 3169 | cifs_put_smb_ses(pSesInfo); |
3162 | else | 3170 | else |
3163 | cifs_put_tcp_session(srvTcp); | 3171 | cifs_put_tcp_session(srvTcp); |
3172 | bdi_destroy(&cifs_sb->bdi); | ||
3164 | goto out; | 3173 | goto out; |
3165 | } | 3174 | } |
3166 | 3175 | ||
@@ -3357,6 +3366,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb) | |||
3357 | } | 3366 | } |
3358 | spin_unlock(&cifs_sb->tlink_tree_lock); | 3367 | spin_unlock(&cifs_sb->tlink_tree_lock); |
3359 | 3368 | ||
3369 | bdi_destroy(&cifs_sb->bdi); | ||
3360 | return 0; | 3370 | return 0; |
3361 | } | 3371 | } |
3362 | 3372 | ||