knfsd: add svc_sock_init
Subsystems (3)
RFC PATCH 13/14 knfsd: add svc_sock_init
Reorganise the svc_sock initialisation code so that new service transport code can use it without duplicating lots of code that futzes with internal transport details (for example the SK_BUSY bit). Transport code should now call svc_sock_init() to initialise the svc_sock structure, then one of svc_sock_add_listener sock_add_connection or svc_sock_add_connectionless, and finally svc_sock_received.
Signed-off-by Greg Banks <[email protected]>
---
include/linux/sunrpc/svcsock.h | 10 ++ net/sunrpc/sunrpc_syms.c | 4 net/sunrpc/svcsock.c | 148 +++++++++++++++++++----------- 3 files changed, 109 insertions(+), 53 deletions(-)
include/linux/sunrpc/svcsock.h +10 -0
@@ -122,6 +122,16 @@ int svc_addsock(struct svc_serv *serv,void svc_sock_enqueue (struct svc_sock *svsk);void svc_sock_received (struct svc_sock *svsk);void __svc_sock_put (struct svc_sock *svsk); +/* Initialise a newly allocated svc_sock. The transport code needs +* to call svc_sock_received() when transport-specific initialisation +* is complete and one of the svc_add_*() functions has been called. */ +void svc_sock_init (struct svc_sock *,struct svc_serv *); +/* Add an initialised connection svc_sock to the server */ +void svc_sock_add_connection (struct svc_sock *); +/* Add an initialised listener svc_sock to the server */ +void svc_sock_add_listener (struct svc_sock *); +/* Add an initialised connectionless svc_sock to the server */ +void svc_sock_add_connectionless (struct svc_sock *);/* * svc_makesock socket characteristics
net/sunrpc/sunrpc_syms.c +4 -0
@@ -77,6 +77,10 @@ EXPORT_SYMBOL(svc_process);EXPORT_SYMBOL (svc_recv);EXPORT_SYMBOL (svc_wake_up);EXPORT_SYMBOL (svc_makesock); +EXPORT_SYMBOL_GPL (svc_sock_init); +EXPORT_SYMBOL_GPL (svc_sock_add_connection); +EXPORT_SYMBOL_GPL (svc_sock_add_listener); +EXPORT_SYMBOL_GPL (svc_sock_add_connectionless);EXPORT_SYMBOL_GPL (svc_sock_enqueue);EXPORT_SYMBOL_GPL (svc_sock_received);EXPORT_SYMBOL (svc_reserve);
net/sunrpc/svcsock.c +95 -53
179 lines not on this page · raw message
Signature · 12 lines
Greg Banks, R&D Software Engineer, SGI Australian Software Group. Apparently, I'm Bedevere. Which MPHG character are you? I don't speak for SGI. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs