Commit 314dfd79 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

SUNRPC: move saved socket callback functions to a private data structure

Move the three fields for saving socket callback functions out of the
rpc_xprt structure and into a private data structure maintained in
net/sunrpc/xprtsock.c.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 7c6e066e
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <linux/sunrpc/xdr.h> #include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/msg_prot.h> #include <linux/sunrpc/msg_prot.h>
#include <net/sock.h>
extern unsigned int xprt_udp_slot_table_entries; extern unsigned int xprt_udp_slot_table_entries;
extern unsigned int xprt_tcp_slot_table_entries; extern unsigned int xprt_tcp_slot_table_entries;
...@@ -191,10 +189,6 @@ struct rpc_xprt { ...@@ -191,10 +189,6 @@ struct rpc_xprt {
bklog_u; /* backlog queue utilization */ bklog_u; /* backlog queue utilization */
} stat; } stat;
void (*old_data_ready)(struct sock *, int);
void (*old_state_change)(struct sock *);
void (*old_write_space)(struct sock *);
char * address_strings[RPC_DISPLAY_MAX]; char * address_strings[RPC_DISPLAY_MAX];
}; };
......
...@@ -157,6 +157,13 @@ struct sock_xprt { ...@@ -157,6 +157,13 @@ struct sock_xprt {
*/ */
size_t rcvsize, size_t rcvsize,
sndsize; sndsize;
/*
* Saved socket callback addresses
*/
void (*old_data_ready)(struct sock *, int);
void (*old_state_change)(struct sock *);
void (*old_write_space)(struct sock *);
}; };
/* /*
...@@ -536,9 +543,9 @@ static void xs_close(struct rpc_xprt *xprt) ...@@ -536,9 +543,9 @@ static void xs_close(struct rpc_xprt *xprt)
transport->sock = NULL; transport->sock = NULL;
sk->sk_user_data = NULL; sk->sk_user_data = NULL;
sk->sk_data_ready = xprt->old_data_ready; sk->sk_data_ready = transport->old_data_ready;
sk->sk_state_change = xprt->old_state_change; sk->sk_state_change = transport->old_state_change;
sk->sk_write_space = xprt->old_write_space; sk->sk_write_space = transport->old_write_space;
write_unlock_bh(&sk->sk_callback_lock); write_unlock_bh(&sk->sk_callback_lock);
sk->sk_no_check = 0; sk->sk_no_check = 0;
...@@ -1147,9 +1154,9 @@ static void xs_udp_connect_worker(void *args) ...@@ -1147,9 +1154,9 @@ static void xs_udp_connect_worker(void *args)
write_lock_bh(&sk->sk_callback_lock); write_lock_bh(&sk->sk_callback_lock);
sk->sk_user_data = xprt; sk->sk_user_data = xprt;
xprt->old_data_ready = sk->sk_data_ready; transport->old_data_ready = sk->sk_data_ready;
xprt->old_state_change = sk->sk_state_change; transport->old_state_change = sk->sk_state_change;
xprt->old_write_space = sk->sk_write_space; transport->old_write_space = sk->sk_write_space;
sk->sk_data_ready = xs_udp_data_ready; sk->sk_data_ready = xs_udp_data_ready;
sk->sk_write_space = xs_udp_write_space; sk->sk_write_space = xs_udp_write_space;
sk->sk_no_check = UDP_CSUM_NORCV; sk->sk_no_check = UDP_CSUM_NORCV;
...@@ -1234,9 +1241,9 @@ static void xs_tcp_connect_worker(void *args) ...@@ -1234,9 +1241,9 @@ static void xs_tcp_connect_worker(void *args)
write_lock_bh(&sk->sk_callback_lock); write_lock_bh(&sk->sk_callback_lock);
sk->sk_user_data = xprt; sk->sk_user_data = xprt;
xprt->old_data_ready = sk->sk_data_ready; transport->old_data_ready = sk->sk_data_ready;
xprt->old_state_change = sk->sk_state_change; transport->old_state_change = sk->sk_state_change;
xprt->old_write_space = sk->sk_write_space; transport->old_write_space = sk->sk_write_space;
sk->sk_data_ready = xs_tcp_data_ready; sk->sk_data_ready = xs_tcp_data_ready;
sk->sk_state_change = xs_tcp_state_change; sk->sk_state_change = xs_tcp_state_change;
sk->sk_write_space = xs_tcp_write_space; sk->sk_write_space = xs_tcp_write_space;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment