aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/cache.c8
-rw-r--r--net/sunrpc/rpc_pipe.c8
-rw-r--r--net/sunrpc/sched.c8
-rw-r--r--net/sunrpc/xprt.c7
-rw-r--r--net/sunrpc/xprtsock.c20
5 files changed, 28 insertions, 23 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 00cb388ece03..d96fd466a9a4 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -284,8 +284,8 @@ static struct file_operations cache_file_operations;
284static struct file_operations content_file_operations; 284static struct file_operations content_file_operations;
285static struct file_operations cache_flush_operations; 285static struct file_operations cache_flush_operations;
286 286
287static void do_cache_clean(void *data); 287static void do_cache_clean(struct work_struct *work);
288static DECLARE_WORK(cache_cleaner, do_cache_clean, NULL); 288static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean);
289 289
290void cache_register(struct cache_detail *cd) 290void cache_register(struct cache_detail *cd)
291{ 291{
@@ -337,7 +337,7 @@ void cache_register(struct cache_detail *cd)
337 spin_unlock(&cache_list_lock); 337 spin_unlock(&cache_list_lock);
338 338
339 /* start the cleaning process */ 339 /* start the cleaning process */
340 schedule_work(&cache_cleaner); 340 schedule_delayed_work(&cache_cleaner, 0);
341} 341}
342 342
343int cache_unregister(struct cache_detail *cd) 343int cache_unregister(struct cache_detail *cd)
@@ -461,7 +461,7 @@ static int cache_clean(void)
461/* 461/*
462 * We want to regularly clean the cache, so we need to schedule some work ... 462 * We want to regularly clean the cache, so we need to schedule some work ...
463 */ 463 */
464static void do_cache_clean(void *data) 464static void do_cache_clean(struct work_struct *work)
465{ 465{
466 int delay = 5; 466 int delay = 5;
467 if (cache_clean() == -1) 467 if (cache_clean() == -1)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9a0b41a97f90..49dba5febbbd 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -54,10 +54,11 @@ static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
54} 54}
55 55
56static void 56static void
57rpc_timeout_upcall_queue(void *data) 57rpc_timeout_upcall_queue(struct work_struct *work)
58{ 58{
59 LIST_HEAD(free_list); 59 LIST_HEAD(free_list);
60 struct rpc_inode *rpci = (struct rpc_inode *)data; 60 struct rpc_inode *rpci =
61 container_of(work, struct rpc_inode, queue_timeout.work);
61 struct inode *inode = &rpci->vfs_inode; 62 struct inode *inode = &rpci->vfs_inode;
62 void (*destroy_msg)(struct rpc_pipe_msg *); 63 void (*destroy_msg)(struct rpc_pipe_msg *);
63 64
@@ -837,7 +838,8 @@ init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
837 INIT_LIST_HEAD(&rpci->pipe); 838 INIT_LIST_HEAD(&rpci->pipe);
838 rpci->pipelen = 0; 839 rpci->pipelen = 0;
839 init_waitqueue_head(&rpci->waitq); 840 init_waitqueue_head(&rpci->waitq);
840 INIT_WORK(&rpci->queue_timeout, rpc_timeout_upcall_queue, rpci); 841 INIT_DELAYED_WORK(&rpci->queue_timeout,
842 rpc_timeout_upcall_queue);
841 rpci->ops = NULL; 843 rpci->ops = NULL;
842 } 844 }
843} 845}
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index a1ab4eed41f4..eff44bcdc95a 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -41,7 +41,7 @@ static mempool_t *rpc_buffer_mempool __read_mostly;
41 41
42static void __rpc_default_timer(struct rpc_task *task); 42static void __rpc_default_timer(struct rpc_task *task);
43static void rpciod_killall(void); 43static void rpciod_killall(void);
44static void rpc_async_schedule(void *); 44static void rpc_async_schedule(struct work_struct *);
45 45
46/* 46/*
47 * RPC tasks sit here while waiting for conditions to improve. 47 * RPC tasks sit here while waiting for conditions to improve.
@@ -305,7 +305,7 @@ static void rpc_make_runnable(struct rpc_task *task)
305 if (RPC_IS_ASYNC(task)) { 305 if (RPC_IS_ASYNC(task)) {
306 int status; 306 int status;
307 307
308 INIT_WORK(&task->u.tk_work, rpc_async_schedule, (void *)task); 308 INIT_WORK(&task->u.tk_work, rpc_async_schedule);
309 status = queue_work(task->tk_workqueue, &task->u.tk_work); 309 status = queue_work(task->tk_workqueue, &task->u.tk_work);
310 if (status < 0) { 310 if (status < 0) {
311 printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status); 311 printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
@@ -695,9 +695,9 @@ rpc_execute(struct rpc_task *task)
695 return __rpc_execute(task); 695 return __rpc_execute(task);
696} 696}
697 697
698static void rpc_async_schedule(void *arg) 698static void rpc_async_schedule(struct work_struct *work)
699{ 699{
700 __rpc_execute((struct rpc_task *)arg); 700 __rpc_execute(container_of(work, struct rpc_task, u.tk_work));
701} 701}
702 702
703/** 703/**
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 80857470dc11..4f9a5d9791fb 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -479,9 +479,10 @@ int xprt_adjust_timeout(struct rpc_rqst *req)
479 return status; 479 return status;
480} 480}
481 481
482static void xprt_autoclose(void *args) 482static void xprt_autoclose(struct work_struct *work)
483{ 483{
484 struct rpc_xprt *xprt = (struct rpc_xprt *)args; 484 struct rpc_xprt *xprt =
485 container_of(work, struct rpc_xprt, task_cleanup);
485 486
486 xprt_disconnect(xprt); 487 xprt_disconnect(xprt);
487 xprt->ops->close(xprt); 488 xprt->ops->close(xprt);
@@ -932,7 +933,7 @@ struct rpc_xprt *xprt_create_transport(int proto, struct sockaddr *ap, size_t si
932 933
933 INIT_LIST_HEAD(&xprt->free); 934 INIT_LIST_HEAD(&xprt->free);
934 INIT_LIST_HEAD(&xprt->recv); 935 INIT_LIST_HEAD(&xprt->recv);
935 INIT_WORK(&xprt->task_cleanup, xprt_autoclose, xprt); 936 INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
936 init_timer(&xprt->timer); 937 init_timer(&xprt->timer);
937 xprt->timer.function = xprt_init_autodisconnect; 938 xprt->timer.function = xprt_init_autodisconnect;
938 xprt->timer.data = (unsigned long) xprt; 939 xprt->timer.data = (unsigned long) xprt;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 757fc91ef25d..cfe3c15be948 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1060,13 +1060,14 @@ static int xs_bindresvport(struct rpc_xprt *xprt, struct socket *sock)
1060 1060
1061/** 1061/**
1062 * xs_udp_connect_worker - set up a UDP socket 1062 * xs_udp_connect_worker - set up a UDP socket
1063 * @args: RPC transport to connect 1063 * @work: RPC transport to connect
1064 * 1064 *
1065 * Invoked by a work queue tasklet. 1065 * Invoked by a work queue tasklet.
1066 */ 1066 */
1067static void xs_udp_connect_worker(void *args) 1067static void xs_udp_connect_worker(struct work_struct *work)
1068{ 1068{
1069 struct rpc_xprt *xprt = (struct rpc_xprt *) args; 1069 struct rpc_xprt *xprt =
1070 container_of(work, struct rpc_xprt, connect_worker.work);
1070 struct socket *sock = xprt->sock; 1071 struct socket *sock = xprt->sock;
1071 int err, status = -EIO; 1072 int err, status = -EIO;
1072 1073
@@ -1144,13 +1145,14 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1144 1145
1145/** 1146/**
1146 * xs_tcp_connect_worker - connect a TCP socket to a remote endpoint 1147 * xs_tcp_connect_worker - connect a TCP socket to a remote endpoint
1147 * @args: RPC transport to connect 1148 * @work: RPC transport to connect
1148 * 1149 *
1149 * Invoked by a work queue tasklet. 1150 * Invoked by a work queue tasklet.
1150 */ 1151 */
1151static void xs_tcp_connect_worker(void *args) 1152static void xs_tcp_connect_worker(struct work_struct *work)
1152{ 1153{
1153 struct rpc_xprt *xprt = (struct rpc_xprt *)args; 1154 struct rpc_xprt *xprt =
1155 container_of(work, struct rpc_xprt, connect_worker.work);
1154 struct socket *sock = xprt->sock; 1156 struct socket *sock = xprt->sock;
1155 int err, status = -EIO; 1157 int err, status = -EIO;
1156 1158
@@ -1262,7 +1264,7 @@ static void xs_connect(struct rpc_task *task)
1262 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; 1264 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO;
1263 } else { 1265 } else {
1264 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); 1266 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt);
1265 schedule_work(&xprt->connect_worker); 1267 schedule_delayed_work(&xprt->connect_worker, 0);
1266 1268
1267 /* flush_scheduled_work can sleep... */ 1269 /* flush_scheduled_work can sleep... */
1268 if (!RPC_IS_ASYNC(task)) 1270 if (!RPC_IS_ASYNC(task))
@@ -1375,7 +1377,7 @@ int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to)
1375 /* XXX: header size can vary due to auth type, IPv6, etc. */ 1377 /* XXX: header size can vary due to auth type, IPv6, etc. */
1376 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); 1378 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3);
1377 1379
1378 INIT_WORK(&xprt->connect_worker, xs_udp_connect_worker, xprt); 1380 INIT_DELAYED_WORK(&xprt->connect_worker, xs_udp_connect_worker);
1379 xprt->bind_timeout = XS_BIND_TO; 1381 xprt->bind_timeout = XS_BIND_TO;
1380 xprt->connect_timeout = XS_UDP_CONN_TO; 1382 xprt->connect_timeout = XS_UDP_CONN_TO;
1381 xprt->reestablish_timeout = XS_UDP_REEST_TO; 1383 xprt->reestablish_timeout = XS_UDP_REEST_TO;
@@ -1420,7 +1422,7 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to)
1420 xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32); 1422 xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32);
1421 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; 1423 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
1422 1424
1423 INIT_WORK(&xprt->connect_worker, xs_tcp_connect_worker, xprt); 1425 INIT_DELAYED_WORK(&xprt->connect_worker, xs_tcp_connect_worker);
1424 xprt->bind_timeout = XS_BIND_TO; 1426 xprt->bind_timeout = XS_BIND_TO;
1425 xprt->connect_timeout = XS_TCP_CONN_TO; 1427 xprt->connect_timeout = XS_TCP_CONN_TO;
1426 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; 1428 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;