summaryrefslogtreecommitdiffstats
path: root/fs/ncpfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r--fs/ncpfs/inode.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 1afee6c7e..36f37c232 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -57,7 +57,7 @@ extern int ncp_symlink(struct inode*, struct dentry*, const char*);
#endif
static struct nw_file_info *read_nwinfo = NULL;
-static struct semaphore read_sem = MUTEX;
+static DECLARE_MUTEX(read_sem);
/*
* Fill in the ncpfs-specific information in the inode.
@@ -346,26 +346,27 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
GFP_KERNEL);
if (server == NULL)
goto out_no_server;
+ memset(server, 0, sizeof(*server));
NCP_SBP(sb) = server;
server->ncp_filp = ncp_filp;
- server->lock = 0;
- server->wait = NULL;
+/* server->lock = 0; */
+ init_MUTEX(&server->sem);
server->packet = NULL;
- server->buffer_size = 0;
- server->conn_status = 0;
- server->root_dentry = NULL;
- server->root_setuped = 0;
+/* server->buffer_size = 0; */
+/* server->conn_status = 0; */
+/* server->root_dentry = NULL; */
+/* server->root_setuped = 0; */
#ifdef CONFIG_NCPFS_PACKET_SIGNING
- server->sign_wanted = 0;
- server->sign_active = 0;
+/* server->sign_wanted = 0; */
+/* server->sign_active = 0; */
#endif
server->auth.auth_type = NCP_AUTH_NONE;
- server->auth.object_name_len = 0;
- server->auth.object_name = NULL;
- server->auth.object_type = 0;
- server->priv.len = 0;
- server->priv.data = NULL;
+/* server->auth.object_name_len = 0; */
+/* server->auth.object_name = NULL; */
+/* server->auth.object_type = 0; */
+/* server->priv.len = 0; */
+/* server->priv.data = NULL; */
server->m = *data;
/* Althought anything producing this is buggy, it happens
@@ -430,7 +431,7 @@ ncp_read_super(struct super_block *sb, void *raw_data, int silent)
if (!root_inode)
goto out_no_root;
DPRINTK(KERN_DEBUG "ncp_read_super: root vol=%d\n", NCP_FINFO(root_inode)->volNumber);
- server->root_dentry = sb->s_root = d_alloc_root(root_inode, NULL);
+ server->root_dentry = sb->s_root = d_alloc_root(root_inode);
if (!sb->s_root)
goto out_no_root;
server->root_dentry->d_op = &ncp_dentry_operations;
@@ -687,7 +688,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
if ((result = ncp_make_open(inode, O_RDWR)) < 0) {
return -EACCES;
}
- ncp_write(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,
+ ncp_write_kernel(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle,
attr->ia_size, 0, "", &written);
/* According to ndir, the changes only take effect after
@@ -723,7 +724,7 @@ int init_module(void)
{
DPRINTK(KERN_DEBUG "ncpfs: init_module called\n");
- read_sem = MUTEX;
+ init_MUTEX(&read_sem);
read_nwinfo = NULL;
#ifdef DEBUG_NCP_MALLOC