aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 15:48:15 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-07 15:48:15 -0500
commit34161db6b14d984fb9b06c735b7b42f8803f6851 (patch)
tree99656278b6697f1cde5b05894b7c0ee22c63a00e /net/sunrpc/xprtsock.c
parent5847e1f4d058677c5e46dc6c3e3c70e8855ea3ba (diff)
parent620034c84d1d939717bdfbe02c51a3fee43541c3 (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/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c22
1 files changed, 12 insertions, 10 deletions
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;