aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-01-14 04:42:39 -0500
committerJens Axboe <axboe@fb.com>2015-01-20 16:03:09 -0500
commit7b14a213890a81473ec97ad7e322d5c2f19854ae (patch)
tree9115cee236cd2fb9ff3e471364ebe0d136260a38 /fs
parente4d2750909aa26129bd0bf1b0dc832e0845aae90 (diff)
nfs: don't call bdi_unregister
bdi_destroy already does all the work, and if we delay freeing the anon bdev we can get away with just that single call. Addintionally remove the call during mount failure, as deactivate_super_locked will already call ->kill_sb and clean up the bdi for us. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/internal.h1
-rw-r--r--fs/nfs/nfs4super.c1
-rw-r--r--fs/nfs/super.c24
3 files changed, 6 insertions, 20 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index efaa31c70fbe..f519d4187332 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -416,7 +416,6 @@ int nfs_show_options(struct seq_file *, struct dentry *);
416int nfs_show_devname(struct seq_file *, struct dentry *); 416int nfs_show_devname(struct seq_file *, struct dentry *);
417int nfs_show_path(struct seq_file *, struct dentry *); 417int nfs_show_path(struct seq_file *, struct dentry *);
418int nfs_show_stats(struct seq_file *, struct dentry *); 418int nfs_show_stats(struct seq_file *, struct dentry *);
419void nfs_put_super(struct super_block *);
420int nfs_remount(struct super_block *sb, int *flags, char *raw_data); 419int nfs_remount(struct super_block *sb, int *flags, char *raw_data);
421 420
422/* write.c */ 421/* write.c */
diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c
index 6f340f02f2ba..ab30a3a637de 100644
--- a/fs/nfs/nfs4super.c
+++ b/fs/nfs/nfs4super.c
@@ -53,7 +53,6 @@ static const struct super_operations nfs4_sops = {
53 .destroy_inode = nfs_destroy_inode, 53 .destroy_inode = nfs_destroy_inode,
54 .write_inode = nfs4_write_inode, 54 .write_inode = nfs4_write_inode,
55 .drop_inode = nfs_drop_inode, 55 .drop_inode = nfs_drop_inode,
56 .put_super = nfs_put_super,
57 .statfs = nfs_statfs, 56 .statfs = nfs_statfs,
58 .evict_inode = nfs4_evict_inode, 57 .evict_inode = nfs4_evict_inode,
59 .umount_begin = nfs_umount_begin, 58 .umount_begin = nfs_umount_begin,
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 31a11b0e885d..6ec4fe23b756 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -311,7 +311,6 @@ const struct super_operations nfs_sops = {
311 .destroy_inode = nfs_destroy_inode, 311 .destroy_inode = nfs_destroy_inode,
312 .write_inode = nfs_write_inode, 312 .write_inode = nfs_write_inode,
313 .drop_inode = nfs_drop_inode, 313 .drop_inode = nfs_drop_inode,
314 .put_super = nfs_put_super,
315 .statfs = nfs_statfs, 314 .statfs = nfs_statfs,
316 .evict_inode = nfs_evict_inode, 315 .evict_inode = nfs_evict_inode,
317 .umount_begin = nfs_umount_begin, 316 .umount_begin = nfs_umount_begin,
@@ -2569,7 +2568,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,
2569 error = nfs_bdi_register(server); 2568 error = nfs_bdi_register(server);
2570 if (error) { 2569 if (error) {
2571 mntroot = ERR_PTR(error); 2570 mntroot = ERR_PTR(error);
2572 goto error_splat_bdi; 2571 goto error_splat_super;
2573 } 2572 }
2574 server->super = s; 2573 server->super = s;
2575 } 2574 }
@@ -2601,9 +2600,6 @@ error_splat_root:
2601 dput(mntroot); 2600 dput(mntroot);
2602 mntroot = ERR_PTR(error); 2601 mntroot = ERR_PTR(error);
2603error_splat_super: 2602error_splat_super:
2604 if (server && !s->s_root)
2605 bdi_unregister(&server->backing_dev_info);
2606error_splat_bdi:
2607 deactivate_locked_super(s); 2603 deactivate_locked_super(s);
2608 goto out; 2604 goto out;
2609} 2605}
@@ -2651,27 +2647,19 @@ out:
2651EXPORT_SYMBOL_GPL(nfs_fs_mount); 2647EXPORT_SYMBOL_GPL(nfs_fs_mount);
2652 2648
2653/* 2649/*
2654 * Ensure that we unregister the bdi before kill_anon_super
2655 * releases the device name
2656 */
2657void nfs_put_super(struct super_block *s)
2658{
2659 struct nfs_server *server = NFS_SB(s);
2660
2661 bdi_unregister(&server->backing_dev_info);
2662}
2663EXPORT_SYMBOL_GPL(nfs_put_super);
2664
2665/*
2666 * Destroy an NFS2/3 superblock 2650 * Destroy an NFS2/3 superblock
2667 */ 2651 */
2668void nfs_kill_super(struct super_block *s) 2652void nfs_kill_super(struct super_block *s)
2669{ 2653{
2670 struct nfs_server *server = NFS_SB(s); 2654 struct nfs_server *server = NFS_SB(s);
2655 dev_t dev = s->s_dev;
2656
2657 generic_shutdown_super(s);
2671 2658
2672 kill_anon_super(s);
2673 nfs_fscache_release_super_cookie(s); 2659 nfs_fscache_release_super_cookie(s);
2660
2674 nfs_free_server(server); 2661 nfs_free_server(server);
2662 free_anon_bdev(dev);
2675} 2663}
2676EXPORT_SYMBOL_GPL(nfs_kill_super); 2664EXPORT_SYMBOL_GPL(nfs_kill_super);
2677 2665