diff options
-rw-r--r-- | fs/ncpfs/inode.c | 19 | ||||
-rw-r--r-- | fs/ncpfs/ncp_fs_sb.h | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 4659da67e7f6..2cf2ebecb55f 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -782,6 +782,17 @@ out: | |||
782 | return error; | 782 | return error; |
783 | } | 783 | } |
784 | 784 | ||
785 | static void delayed_free(struct rcu_head *p) | ||
786 | { | ||
787 | struct ncp_server *server = container_of(p, struct ncp_server, rcu); | ||
788 | #ifdef CONFIG_NCPFS_NLS | ||
789 | /* unload the NLS charsets */ | ||
790 | unload_nls(server->nls_vol); | ||
791 | unload_nls(server->nls_io); | ||
792 | #endif /* CONFIG_NCPFS_NLS */ | ||
793 | kfree(server); | ||
794 | } | ||
795 | |||
785 | static void ncp_put_super(struct super_block *sb) | 796 | static void ncp_put_super(struct super_block *sb) |
786 | { | 797 | { |
787 | struct ncp_server *server = NCP_SBP(sb); | 798 | struct ncp_server *server = NCP_SBP(sb); |
@@ -792,11 +803,6 @@ static void ncp_put_super(struct super_block *sb) | |||
792 | 803 | ||
793 | ncp_stop_tasks(server); | 804 | ncp_stop_tasks(server); |
794 | 805 | ||
795 | #ifdef CONFIG_NCPFS_NLS | ||
796 | /* unload the NLS charsets */ | ||
797 | unload_nls(server->nls_vol); | ||
798 | unload_nls(server->nls_io); | ||
799 | #endif /* CONFIG_NCPFS_NLS */ | ||
800 | mutex_destroy(&server->rcv.creq_mutex); | 806 | mutex_destroy(&server->rcv.creq_mutex); |
801 | mutex_destroy(&server->root_setup_lock); | 807 | mutex_destroy(&server->root_setup_lock); |
802 | mutex_destroy(&server->mutex); | 808 | mutex_destroy(&server->mutex); |
@@ -813,8 +819,7 @@ static void ncp_put_super(struct super_block *sb) | |||
813 | vfree(server->rxbuf); | 819 | vfree(server->rxbuf); |
814 | vfree(server->txbuf); | 820 | vfree(server->txbuf); |
815 | vfree(server->packet); | 821 | vfree(server->packet); |
816 | sb->s_fs_info = NULL; | 822 | call_rcu(&server->rcu, delayed_free); |
817 | kfree(server); | ||
818 | } | 823 | } |
819 | 824 | ||
820 | static int ncp_statfs(struct dentry *dentry, struct kstatfs *buf) | 825 | static int ncp_statfs(struct dentry *dentry, struct kstatfs *buf) |
diff --git a/fs/ncpfs/ncp_fs_sb.h b/fs/ncpfs/ncp_fs_sb.h index c51b2c543539..b81e97adc5a9 100644 --- a/fs/ncpfs/ncp_fs_sb.h +++ b/fs/ncpfs/ncp_fs_sb.h | |||
@@ -38,7 +38,7 @@ struct ncp_mount_data_kernel { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct ncp_server { | 40 | struct ncp_server { |
41 | 41 | struct rcu_head rcu; | |
42 | struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of | 42 | struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of |
43 | interest for us later, so we store | 43 | interest for us later, so we store |
44 | it completely. */ | 44 | it completely. */ |