aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r--fs/ncpfs/inode.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index d290545aa0c4..9b39a5dd4131 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -26,10 +26,10 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/smp_lock.h>
30#include <linux/vfs.h> 29#include <linux/vfs.h>
31#include <linux/mount.h> 30#include <linux/mount.h>
32#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32#include <linux/namei.h>
33 33
34#include <linux/ncp_fs.h> 34#include <linux/ncp_fs.h>
35 35
@@ -59,11 +59,18 @@ static struct inode *ncp_alloc_inode(struct super_block *sb)
59 return &ei->vfs_inode; 59 return &ei->vfs_inode;
60} 60}
61 61
62static void ncp_destroy_inode(struct inode *inode) 62static void ncp_i_callback(struct rcu_head *head)
63{ 63{
64 struct inode *inode = container_of(head, struct inode, i_rcu);
65 INIT_LIST_HEAD(&inode->i_dentry);
64 kmem_cache_free(ncp_inode_cachep, NCP_FINFO(inode)); 66 kmem_cache_free(ncp_inode_cachep, NCP_FINFO(inode));
65} 67}
66 68
69static void ncp_destroy_inode(struct inode *inode)
70{
71 call_rcu(&inode->i_rcu, ncp_i_callback);
72}
73
67static void init_once(void *foo) 74static void init_once(void *foo)
68{ 75{
69 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo; 76 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
@@ -310,7 +317,12 @@ static void ncp_stop_tasks(struct ncp_server *server) {
310 sk->sk_write_space = server->write_space; 317 sk->sk_write_space = server->write_space;
311 release_sock(sk); 318 release_sock(sk);
312 del_timer_sync(&server->timeout_tm); 319 del_timer_sync(&server->timeout_tm);
313 flush_scheduled_work(); 320
321 flush_work_sync(&server->rcv.tq);
322 if (sk->sk_socket->type == SOCK_STREAM)
323 flush_work_sync(&server->tx.tq);
324 else
325 flush_work_sync(&server->timeout_tq);
314} 326}
315 327
316static int ncp_show_options(struct seq_file *seq, struct vfsmount *mnt) 328static int ncp_show_options(struct seq_file *seq, struct vfsmount *mnt)
@@ -711,7 +723,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
711 sb->s_root = d_alloc_root(root_inode); 723 sb->s_root = d_alloc_root(root_inode);
712 if (!sb->s_root) 724 if (!sb->s_root)
713 goto out_no_root; 725 goto out_no_root;
714 sb->s_root->d_op = &ncp_root_dentry_operations; 726 d_set_d_op(sb->s_root, &ncp_root_dentry_operations);
715 return 0; 727 return 0;
716 728
717out_no_root: 729out_no_root: