aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smbfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/smbfs')
-rw-r--r--fs/smbfs/file.c2
-rw-r--r--fs/smbfs/inode.c6
-rw-r--r--fs/smbfs/proc.c1
-rw-r--r--fs/smbfs/proto.h2
-rw-r--r--fs/smbfs/request.c9
-rw-r--r--fs/smbfs/smbiod.c30
6 files changed, 24 insertions, 26 deletions
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index ed9a24d19d7d..dae67048baba 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -306,7 +306,7 @@ static int smb_commit_write(struct file *file, struct page *page,
306 return status; 306 return status;
307} 307}
308 308
309struct address_space_operations smb_file_aops = { 309const struct address_space_operations smb_file_aops = {
310 .readpage = smb_readpage, 310 .readpage = smb_readpage,
311 .writepage = smb_writepage, 311 .writepage = smb_writepage,
312 .prepare_write = smb_prepare_write, 312 .prepare_write = smb_prepare_write,
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 506ff87c1d4b..2c122ee83adb 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -7,7 +7,6 @@
7 * Please add a note about your changes to smbfs in the ChangeLog file. 7 * Please add a note about your changes to smbfs in the ChangeLog file.
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/time.h> 11#include <linux/time.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
@@ -90,8 +89,7 @@ static int init_inodecache(void)
90 89
91static void destroy_inodecache(void) 90static void destroy_inodecache(void)
92{ 91{
93 if (kmem_cache_destroy(smb_inode_cachep)) 92 kmem_cache_destroy(smb_inode_cachep);
94 printk(KERN_INFO "smb_inode_cache: not all structures were freed\n");
95} 93}
96 94
97static int smb_remount(struct super_block *sb, int *flags, char *data) 95static int smb_remount(struct super_block *sb, int *flags, char *data)
@@ -168,7 +166,6 @@ smb_get_inode_attr(struct inode *inode, struct smb_fattr *fattr)
168 fattr->f_mtime = inode->i_mtime; 166 fattr->f_mtime = inode->i_mtime;
169 fattr->f_ctime = inode->i_ctime; 167 fattr->f_ctime = inode->i_ctime;
170 fattr->f_atime = inode->i_atime; 168 fattr->f_atime = inode->i_atime;
171 fattr->f_blksize= inode->i_blksize;
172 fattr->f_blocks = inode->i_blocks; 169 fattr->f_blocks = inode->i_blocks;
173 170
174 fattr->attr = SMB_I(inode)->attr; 171 fattr->attr = SMB_I(inode)->attr;
@@ -202,7 +199,6 @@ smb_set_inode_attr(struct inode *inode, struct smb_fattr *fattr)
202 inode->i_uid = fattr->f_uid; 199 inode->i_uid = fattr->f_uid;
203 inode->i_gid = fattr->f_gid; 200 inode->i_gid = fattr->f_gid;
204 inode->i_ctime = fattr->f_ctime; 201 inode->i_ctime = fattr->f_ctime;
205 inode->i_blksize= fattr->f_blksize;
206 inode->i_blocks = fattr->f_blocks; 202 inode->i_blocks = fattr->f_blocks;
207 inode->i_size = fattr->f_size; 203 inode->i_size = fattr->f_size;
208 inode->i_mtime = fattr->f_mtime; 204 inode->i_mtime = fattr->f_mtime;
diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c
index c3495059889d..40e174db9872 100644
--- a/fs/smbfs/proc.c
+++ b/fs/smbfs/proc.c
@@ -1826,7 +1826,6 @@ smb_init_dirent(struct smb_sb_info *server, struct smb_fattr *fattr)
1826 fattr->f_nlink = 1; 1826 fattr->f_nlink = 1;
1827 fattr->f_uid = server->mnt->uid; 1827 fattr->f_uid = server->mnt->uid;
1828 fattr->f_gid = server->mnt->gid; 1828 fattr->f_gid = server->mnt->gid;
1829 fattr->f_blksize = SMB_ST_BLKSIZE;
1830 fattr->f_unix = 0; 1829 fattr->f_unix = 0;
1831} 1830}
1832 1831
diff --git a/fs/smbfs/proto.h b/fs/smbfs/proto.h
index 972ed7dad388..34fb462b2379 100644
--- a/fs/smbfs/proto.h
+++ b/fs/smbfs/proto.h
@@ -63,7 +63,7 @@ extern int smb_revalidate_inode(struct dentry *dentry);
63extern int smb_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); 63extern int smb_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
64extern int smb_notify_change(struct dentry *dentry, struct iattr *attr); 64extern int smb_notify_change(struct dentry *dentry, struct iattr *attr);
65/* file.c */ 65/* file.c */
66extern struct address_space_operations smb_file_aops; 66extern const struct address_space_operations smb_file_aops;
67extern const struct file_operations smb_file_operations; 67extern const struct file_operations smb_file_operations;
68extern struct inode_operations smb_file_inode_operations; 68extern struct inode_operations smb_file_inode_operations;
69/* ioctl.c */ 69/* ioctl.c */
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c
index c71dd2760d32..0fb74697abc4 100644
--- a/fs/smbfs/request.c
+++ b/fs/smbfs/request.c
@@ -49,8 +49,7 @@ int smb_init_request_cache(void)
49 49
50void smb_destroy_request_cache(void) 50void smb_destroy_request_cache(void)
51{ 51{
52 if (kmem_cache_destroy(req_cachep)) 52 kmem_cache_destroy(req_cachep);
53 printk(KERN_INFO "smb_destroy_request_cache: not all structures were freed\n");
54} 53}
55 54
56/* 55/*
@@ -400,8 +399,7 @@ static int smb_request_send_req(struct smb_request *req)
400 if (!(req->rq_flags & SMB_REQ_TRANSMITTED)) 399 if (!(req->rq_flags & SMB_REQ_TRANSMITTED))
401 goto out; 400 goto out;
402 401
403 list_del_init(&req->rq_queue); 402 list_move_tail(&req->rq_queue, &server->recvq);
404 list_add_tail(&req->rq_queue, &server->recvq);
405 result = 1; 403 result = 1;
406out: 404out:
407 return result; 405 return result;
@@ -435,8 +433,7 @@ int smb_request_send_server(struct smb_sb_info *server)
435 result = smb_request_send_req(req); 433 result = smb_request_send_req(req);
436 if (result < 0) { 434 if (result < 0) {
437 server->conn_error = result; 435 server->conn_error = result;
438 list_del_init(&req->rq_queue); 436 list_move(&req->rq_queue, &server->xmitq);
439 list_add(&req->rq_queue, &server->xmitq);
440 result = -EIO; 437 result = -EIO;
441 goto out; 438 goto out;
442 } 439 }
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index 481a97a423fa..e67540441288 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -5,7 +5,6 @@
5 * Copyright (C) 2001, Urban Widmark 5 * Copyright (C) 2001, Urban Widmark
6 */ 6 */
7 7
8#include <linux/config.h>
9 8
10#include <linux/sched.h> 9#include <linux/sched.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
@@ -20,6 +19,7 @@
20#include <linux/smp_lock.h> 19#include <linux/smp_lock.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/net.h> 21#include <linux/net.h>
22#include <linux/kthread.h>
23#include <net/ip.h> 23#include <net/ip.h>
24 24
25#include <linux/smb_fs.h> 25#include <linux/smb_fs.h>
@@ -40,7 +40,7 @@ enum smbiod_state {
40}; 40};
41 41
42static enum smbiod_state smbiod_state = SMBIOD_DEAD; 42static enum smbiod_state smbiod_state = SMBIOD_DEAD;
43static pid_t smbiod_pid; 43static struct task_struct *smbiod_thread;
44static DECLARE_WAIT_QUEUE_HEAD(smbiod_wait); 44static DECLARE_WAIT_QUEUE_HEAD(smbiod_wait);
45static LIST_HEAD(smb_servers); 45static LIST_HEAD(smb_servers);
46static DEFINE_SPINLOCK(servers_lock); 46static DEFINE_SPINLOCK(servers_lock);
@@ -67,20 +67,29 @@ void smbiod_wake_up(void)
67 */ 67 */
68static int smbiod_start(void) 68static int smbiod_start(void)
69{ 69{
70 pid_t pid; 70 struct task_struct *tsk;
71 int err = 0;
72
71 if (smbiod_state != SMBIOD_DEAD) 73 if (smbiod_state != SMBIOD_DEAD)
72 return 0; 74 return 0;
73 smbiod_state = SMBIOD_STARTING; 75 smbiod_state = SMBIOD_STARTING;
74 __module_get(THIS_MODULE); 76 __module_get(THIS_MODULE);
75 spin_unlock(&servers_lock); 77 spin_unlock(&servers_lock);
76 pid = kernel_thread(smbiod, NULL, 0); 78 tsk = kthread_run(smbiod, NULL, "smbiod");
77 if (pid < 0) 79 if (IS_ERR(tsk)) {
80 err = PTR_ERR(tsk);
78 module_put(THIS_MODULE); 81 module_put(THIS_MODULE);
82 }
79 83
80 spin_lock(&servers_lock); 84 spin_lock(&servers_lock);
81 smbiod_state = pid < 0 ? SMBIOD_DEAD : SMBIOD_RUNNING; 85 if (err < 0) {
82 smbiod_pid = pid; 86 smbiod_state = SMBIOD_DEAD;
83 return pid; 87 smbiod_thread = NULL;
88 } else {
89 smbiod_state = SMBIOD_RUNNING;
90 smbiod_thread = tsk;
91 }
92 return err;
84} 93}
85 94
86/* 95/*
@@ -183,8 +192,7 @@ int smbiod_retry(struct smb_sb_info *server)
183 if (req->rq_flags & SMB_REQ_RETRY) { 192 if (req->rq_flags & SMB_REQ_RETRY) {
184 /* must move the request to the xmitq */ 193 /* must move the request to the xmitq */
185 VERBOSE("retrying request %p on recvq\n", req); 194 VERBOSE("retrying request %p on recvq\n", req);
186 list_del(&req->rq_queue); 195 list_move(&req->rq_queue, &server->xmitq);
187 list_add(&req->rq_queue, &server->xmitq);
188 continue; 196 continue;
189 } 197 }
190#endif 198#endif
@@ -290,8 +298,6 @@ out:
290 */ 298 */
291static int smbiod(void *unused) 299static int smbiod(void *unused)
292{ 300{
293 daemonize("smbiod");
294
295 allow_signal(SIGKILL); 301 allow_signal(SIGKILL);
296 302
297 VERBOSE("SMB Kernel thread starting (%d) ...\n", current->pid); 303 VERBOSE("SMB Kernel thread starting (%d) ...\n", current->pid);