From: Trond Myklebust Date: Thu, 7 Dec 2006 20:48:15 +0000 (-0500) Subject: Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ into merge_linus X-Git-Tag: v2.6.20-rc1~34^2~412^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34161db6b14d984fb9b06c735b7b42f8803f6851;p=linux-2.6 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. --- 34161db6b14d984fb9b06c735b7b42f8803f6851 diff --cc net/sunrpc/xprtsock.c index 21438d7dc4,cfe3c15be9..3bb232eb5d --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@@ -211,55 -125,6 +211,55 @@@ static inline void xs_pktdump(char *msg } #endif +struct sock_xprt { + struct rpc_xprt xprt; + + /* + * Network layer + */ + struct socket * sock; + struct sock * inet; + + /* + * State of TCP reply receive + */ + __be32 tcp_fraghdr, + tcp_xid; + + u32 tcp_offset, + tcp_reclen; + + unsigned long tcp_copied, + tcp_flags; + + /* + * Connection of transports + */ - struct work_struct connect_worker; ++ struct delayed_work connect_worker; + unsigned short port; + + /* + * UDP socket buffer size parameters + */ + size_t rcvsize, + sndsize; + + /* + * Saved socket callback addresses + */ + void (*old_data_ready)(struct sock *, int); + void (*old_state_change)(struct sock *); + void (*old_write_space)(struct sock *); +}; + +/* + * TCP receive state flags + */ +#define TCP_RCV_LAST_FRAG (1UL << 0) +#define TCP_RCV_COPY_FRAGHDR (1UL << 1) +#define TCP_RCV_COPY_XID (1UL << 2) +#define TCP_RCV_COPY_DATA (1UL << 3) + static void xs_format_peer_addresses(struct rpc_xprt *xprt) { struct sockaddr_in *addr = (struct sockaddr_in *) &xprt->addr; @@@ -1179,11 -1064,11 +1179,12 @@@ static int xs_bindresvport(struct sock_ * * Invoked by a work queue tasklet. */ - static void xs_udp_connect_worker(void *args) + static void xs_udp_connect_worker(struct work_struct *work) { - struct sock_xprt *transport = (struct sock_xprt *)args; - struct rpc_xprt *xprt = - container_of(work, struct rpc_xprt, connect_worker.work); - struct socket *sock = xprt->sock; ++ struct sock_xprt *transport = ++ container_of(work, struct sock_xprt, connect_worker.work); + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; int err, status = -EIO; if (xprt->shutdown || !xprt_bound(xprt)) @@@ -1264,11 -1149,11 +1265,12 @@@ static void xs_tcp_reuse_connection(str * * Invoked by a work queue tasklet. */ - static void xs_tcp_connect_worker(void *args) + static void xs_tcp_connect_worker(struct work_struct *work) { - struct sock_xprt *transport = (struct sock_xprt *)args; - struct rpc_xprt *xprt = - container_of(work, struct rpc_xprt, connect_worker.work); - struct socket *sock = xprt->sock; ++ struct sock_xprt *transport = ++ container_of(work, struct sock_xprt, connect_worker.work); + struct rpc_xprt *xprt = &transport->xprt; + struct socket *sock = transport->sock; int err, status = -EIO; if (xprt->shutdown || !xprt_bound(xprt)) @@@ -1380,7 -1264,7 +1382,7 @@@ static void xs_connect(struct rpc_task xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; } else { dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); - schedule_work(&transport->connect_worker); - schedule_delayed_work(&xprt->connect_worker, 0); ++ schedule_delayed_work(&transport->connect_worker, 0); /* flush_scheduled_work can sleep... */ if (!RPC_IS_ASYNC(task)) @@@ -1525,7 -1377,7 +1527,7 @@@ struct rpc_xprt *xs_setup_udp(struct so /* XXX: header size can vary due to auth type, IPv6, etc. */ xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); - INIT_WORK(&transport->connect_worker, xs_udp_connect_worker, transport); - INIT_DELAYED_WORK(&xprt->connect_worker, xs_udp_connect_worker); ++ INIT_DELAYED_WORK(&transport->connect_worker, xs_udp_connect_worker); xprt->bind_timeout = XS_BIND_TO; xprt->connect_timeout = XS_UDP_CONN_TO; xprt->reestablish_timeout = XS_UDP_REEST_TO; @@@ -1569,7 -1422,7 +1571,7 @@@ struct rpc_xprt *xs_setup_tcp(struct so xprt->tsh_size = sizeof(rpc_fraghdr) / sizeof(u32); xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; - INIT_WORK(&transport->connect_worker, xs_tcp_connect_worker, transport); - INIT_DELAYED_WORK(&xprt->connect_worker, xs_tcp_connect_worker); ++ INIT_DELAYED_WORK(&transport->connect_worker, xs_tcp_connect_worker); xprt->bind_timeout = XS_BIND_TO; xprt->connect_timeout = XS_TCP_CONN_TO; xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;