diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-07 15:48:15 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-07 15:48:15 -0500 |
commit | 34161db6b14d984fb9b06c735b7b42f8803f6851 (patch) | |
tree | 99656278b6697f1cde5b05894b7c0ee22c63a00e /net/sunrpc | |
parent | 5847e1f4d058677c5e46dc6c3e3c70e8855ea3ba (diff) | |
parent | 620034c84d1d939717bdfbe02c51a3fee43541c3 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ into merge_linus
Conflicts:
include/linux/sunrpc/xprt.h
net/sunrpc/xprtsock.c
Fix up conflicts with the workqueue changes.
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/cache.c | 8 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 8 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 8 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 7 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 22 |
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; | |||
284 | static struct file_operations content_file_operations; | 284 | static struct file_operations content_file_operations; |
285 | static struct file_operations cache_flush_operations; | 285 | static struct file_operations cache_flush_operations; |
286 | 286 | ||
287 | static void do_cache_clean(void *data); | 287 | static void do_cache_clean(struct work_struct *work); |
288 | static DECLARE_WORK(cache_cleaner, do_cache_clean, NULL); | 288 | static DECLARE_DELAYED_WORK(cache_cleaner, do_cache_clean); |
289 | 289 | ||
290 | void cache_register(struct cache_detail *cd) | 290 | void 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 | ||
343 | int cache_unregister(struct cache_detail *cd) | 343 | int 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 | */ |
464 | static void do_cache_clean(void *data) | 464 | static 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 | ||
56 | static void | 56 | static void |
57 | rpc_timeout_upcall_queue(void *data) | 57 | rpc_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 | ||
42 | static void __rpc_default_timer(struct rpc_task *task); | 42 | static void __rpc_default_timer(struct rpc_task *task); |
43 | static void rpciod_killall(void); | 43 | static void rpciod_killall(void); |
44 | static void rpc_async_schedule(void *); | 44 | static 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 | ||
732 | static void rpc_async_schedule(void *arg) | 732 | static 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 | ||
480 | static void xprt_autoclose(void *args) | 480 | static 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 | */ |
1182 | static void xs_udp_connect_worker(void *args) | 1182 | static 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 | */ |
1267 | static void xs_tcp_connect_worker(void *args) | 1268 | static 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; |