X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fncpfs%2Finode.c;h=a1f3e972c6ef78bda1a18249a82aedb727f9a1cf;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=44795d2f4b30856790ce214d2c10386c1122cf6b;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 44795d2f4..a1f3e972c 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -63,7 +63,7 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == SLAB_CTOR_CONSTRUCTOR) { - init_MUTEX(&ei->open_sem); + mutex_init(&ei->open_mutex); inode_init_once(&ei->vfs_inode); } } @@ -72,7 +72,8 @@ static int init_inodecache(void) { ncp_inode_cachep = kmem_cache_create("ncp_inode_cache", sizeof(struct ncp_inode_info), - 0, SLAB_RECLAIM_ACCOUNT, + 0, (SLAB_RECLAIM_ACCOUNT| + SLAB_MEM_SPREAD), init_once, NULL); if (ncp_inode_cachep == NULL) return -ENOMEM; @@ -286,6 +287,8 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info) static void ncp_delete_inode(struct inode *inode) { + truncate_inode_pages(&inode->i_data, 0); + if (S_ISDIR(inode->i_mode)) { DDPRINTK("ncp_delete_inode: put directory %ld\n", inode->i_ino); } @@ -518,7 +521,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) } /* server->lock = 0; */ - init_MUTEX(&server->sem); + mutex_init(&server->mutex); server->packet = NULL; /* server->buffer_size = 0; */ /* server->conn_status = 0; */ @@ -555,7 +558,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) server->dentry_ttl = 0; /* no caching */ INIT_LIST_HEAD(&server->tx.requests); - init_MUTEX(&server->rcv.creq_sem); + mutex_init(&server->rcv.creq_mutex); server->tx.creq = NULL; server->rcv.creq = NULL; server->data_ready = sock->sk->sk_data_ready; @@ -714,10 +717,8 @@ static void ncp_put_super(struct super_block *sb) fput(server->ncp_filp); kill_proc(server->m.wdog_pid, SIGTERM, 1); - if (server->priv.data) - ncp_kfree_s(server->priv.data, server->priv.len); - if (server->auth.object_name) - ncp_kfree_s(server->auth.object_name, server->auth.object_name_len); + kfree(server->priv.data); + kfree(server->auth.object_name); vfree(server->packet); sb->s_fs_info = NULL; kfree(server); @@ -956,11 +957,6 @@ out: return result; } -#ifdef DEBUG_NCP_MALLOC -int ncp_malloced; -int ncp_current_malloced; -#endif - static struct super_block *ncp_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { @@ -979,10 +975,6 @@ static int __init init_ncp_fs(void) int err; DPRINTK("ncpfs: init_module called\n"); -#ifdef DEBUG_NCP_MALLOC - ncp_malloced = 0; - ncp_current_malloced = 0; -#endif err = init_inodecache(); if (err) goto out1; @@ -1001,10 +993,6 @@ static void __exit exit_ncp_fs(void) DPRINTK("ncpfs: cleanup_module called\n"); unregister_filesystem(&ncp_fs_type); destroy_inodecache(); -#ifdef DEBUG_NCP_MALLOC - PRINTK("ncp_malloced: %d\n", ncp_malloced); - PRINTK("ncp_current_malloced: %d\n", ncp_current_malloced); -#endif } module_init(init_ncp_fs)