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.c22
5 files changed, 29 insertions, 24 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 f9fd66b1d48b..18a33d327012 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.
@@ -323,7 +323,7 @@ static void rpc_make_runnable(struct rpc_task *task)
323 if (RPC_IS_ASYNC(task)) { 323 if (RPC_IS_ASYNC(task)) {
324 int status; 324 int status;
325 325
326 INIT_WORK(&task->u.tk_work, rpc_async_schedule, (void *)task); 326 INIT_WORK(&task->u.tk_work, rpc_async_schedule);
327 status = queue_work(task->tk_workqueue, &task->u.tk_work); 327 status = queue_work(task->tk_workqueue, &task->u.tk_work);
328 if (status < 0) { 328 if (status < 0) {
329 printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status); 329 printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
@@ -729,9 +729,9 @@ rpc_execute(struct rpc_task *task)
729 return __rpc_execute(task); 729 return __rpc_execute(task);
730} 730}
731 731
732static void rpc_async_schedule(void *arg) 732static void rpc_async_schedule(struct work_struct *work)
733{ 733{
734 __rpc_execute((struct rpc_task *)arg); 734 __rpc_execute(container_of(work, struct rpc_task, u.tk_work));
735} 735}
736 736
737/** 737/**
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index f8ca0a93454c..7a3999f0a4a2 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -477,9 +477,10 @@ int xprt_adjust_timeout(struct rpc_rqst *req)
477 return status; 477 return status;
478} 478}
479 479
480static void xprt_autoclose(void *args) 480static void xprt_autoclose(struct work_struct *work)
481{ 481{
482 struct rpc_xprt *xprt = (struct rpc_xprt *)args; 482 struct rpc_xprt *xprt =
483 container_of(work, struct rpc_xprt, task_cleanup);
483 484
484 xprt_disconnect(xprt); 485 xprt_disconnect(xprt);
485 xprt->ops->close(xprt); 486 xprt->ops->close(xprt);
@@ -916,7 +917,7 @@ struct rpc_xprt *xprt_create_transport(int proto, struct sockaddr *ap, size_t si
916 917
917 INIT_LIST_HEAD(&xprt->free); 918 INIT_LIST_HEAD(&xprt->free);
918 INIT_LIST_HEAD(&xprt->recv); 919 INIT_LIST_HEAD(&xprt->recv);
919 INIT_WORK(&xprt->task_cleanup, xprt_autoclose, xprt); 920 INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
920 init_timer(&xprt->timer); 921 init_timer(&xprt->timer);
921 xprt->timer.function = xprt_init_autodisconnect; 922 xprt->timer.function = xprt_init_autodisconnect;
922 xprt->timer.data = (unsigned long) xprt; 923 xprt->timer.data = (unsigned long) xprt;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 21438d7dc47b..3bb232eb5d90 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -235,7 +235,7 @@ struct sock_xprt {
235 /* 235 /*
236 * Connection of transports 236 * Connection of transports
237 */ 237 */
238 struct work_struct connect_worker; 238 struct delayed_work connect_worker;
239 unsigned short port; 239 unsigned short port;
240 240
241 /* 241 /*
@@ -1175,13 +1175,14 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock)
1175 1175
1176/** 1176/**
1177 * xs_udp_connect_worker - set up a UDP socket 1177 * xs_udp_connect_worker - set up a UDP socket
1178 * @args: RPC transport to connect 1178 * @work: RPC transport to connect
1179 * 1179 *
1180 * Invoked by a work queue tasklet. 1180 * Invoked by a work queue tasklet.
1181 */ 1181 */
1182static void xs_udp_connect_worker(void *args) 1182static void xs_udp_connect_worker(struct work_struct *work)
1183{ 1183{
1184 struct sock_xprt *transport = (struct sock_xprt *)args; 1184 struct sock_xprt *transport =
1185 container_of(work, struct sock_xprt, connect_worker.work);
1185 struct rpc_xprt *xprt = &transport->xprt; 1186 struct rpc_xprt *xprt = &transport->xprt;
1186 struct socket *sock = transport->sock; 1187 struct socket *sock = transport->sock;
1187 int err, status = -EIO; 1188 int err, status = -EIO;
@@ -1260,13 +1261,14 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1260 1261
1261/** 1262/**
1262 * xs_tcp_connect_worker - connect a TCP socket to a remote endpoint 1263 * xs_tcp_connect_worker - connect a TCP socket to a remote endpoint
1263 * @args: RPC transport to connect 1264 * @work: RPC transport to connect
1264 * 1265 *
1265 * Invoked by a work queue tasklet. 1266 * Invoked by a work queue tasklet.
1266 */ 1267 */
1267static void xs_tcp_connect_worker(void *args) 1268static void xs_tcp_connect_worker(struct work_struct *work)
1268{ 1269{
1269 struct sock_xprt *transport = (struct sock_xprt *)args; 1270 struct sock_xprt *transport =
1271 container_of(work, struct sock_xprt, connect_worker.work);
1270 struct rpc_xprt *xprt = &transport->xprt; 1272 struct rpc_xprt *xprt = &transport->xprt;
1271 struct socket *sock = transport->sock; 1273 struct socket *sock = transport->sock;
1272 int err, status = -EIO; 1274 int err, status = -EIO;
@@ -1380,7 +1382,7 @@ static void xs_connect(struct rpc_task *task)
1380 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; 1382 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO;
1381 } else { 1383 } else {
1382 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); 1384 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt);
1383 schedule_work(&transport->connect_worker); 1385 schedule_delayed_work(&transport->connect_worker, 0);
1384 1386
1385 /* flush_scheduled_work can sleep... */ 1387 /* flush_scheduled_work can sleep... */
1386 if (!RPC_IS_ASYNC(task)) 1388 if (!RPC_IS_ASYNC(task))
@@ -1525,7 +1527,7 @@ struct rpc_xprt *xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_
1525 /* XXX: header size can vary due to auth type, IPv6, etc. */ 1527 /* XXX: header size can vary due to auth type, IPv6, etc. */
1526 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); 1528 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3);
1527 1529
1528 INIT_WORK(&transport->connect_worker, xs_udp_connect_worker, transport); 1530 INIT_DELAYED_WORK(&transport->connect_worker, xs_udp_connect_worker);
1529 xprt->bind_timeout = XS_BIND_TO; 1531 xprt->bind_timeout = XS_BIND_TO;
1530 xprt->connect_timeout = XS_UDP_CONN_TO; 1532 xprt->connect_timeout = XS_UDP_CONN_TO;
1531 xprt->reestablish_timeout = XS_UDP_REEST_TO; 1533 xprt->reestablish_timeout = XS_UDP_REEST_TO;
@@ -1569,7 +1571,7 @@ struct rpc_xprt *xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_
1569 xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32); 1571 xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32);
1570 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; 1572 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
1571 1573
1572 INIT_WORK(&transport->connect_worker, xs_tcp_connect_worker, transport); 1574 INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker);
1573 xprt->bind_timeout = XS_BIND_TO; 1575 xprt->bind_timeout = XS_BIND_TO;
1574 xprt->connect_timeout = XS_TCP_CONN_TO; 1576 xprt->connect_timeout = XS_TCP_CONN_TO;
1575 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; 1577 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;