1
0
Fork 0
alistair23-linux/include/linux/sunrpc
Tom Tucker 9dbc240f19 svc: Move the sockaddr information to svc_xprt
This patch moves the transport sockaddr to the svc_xprt
structure.  Convenience functions are added to set and
get the local and remote addresses of a transport from
the transport provider as well as determine the length
of a sockaddr.

A transport is responsible for setting the xpt_local
and xpt_remote addresses in the svc_xprt structure as
part of transport creation and xpo_accept processing. This
cannot be done in a generic way and in fact varies
between TCP, UDP and RDMA. A set of xpo_ functions
(e.g. getlocalname, getremotename) could have been
added but this would have resulted in additional
caching and copying of the addresses around.  Note that
the xpt_local address should also be set on listening
endpoints; for TCP/RDMA this is done as part of
endpoint creation.

For connected transports like TCP and RDMA, the addresses
never change and can be set once and copied into the
rqstp structure for each request. For UDP, however, the
local and remote addresses may change for each request. In
this case, the address information is obtained from the
UDP recvmsg info and copied into the rqstp structure from
there.

A svc_xprt_local_port function was also added that returns
the local port given a transport. This is used by
svc_create_xprt when returning the port associated with
a newly created transport, and later when creating a
generic find transport service to check if a service is
already listening on a given port.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Acked-by: Neil Brown <neilb@suse.de>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Greg Banks <gnb@sgi.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2008-02-01 16:42:12 -05:00
..
Kbuild
auth.h SUNRPC: Convert the credential garbage collector into a shrinker callback 2007-07-10 23:40:36 -04:00
auth_gss.h SUNRPC: Convert gss_ctx_lock to an RCU lock 2007-07-10 23:40:36 -04:00
cache.h knfsd: allow cache_register to return error on failure 2008-02-01 16:42:05 -05:00
clnt.h Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc 2008-02-01 11:45:47 +11:00
debug.h svc: Make svc_sock the tcp/udp transport 2008-02-01 16:42:07 -05:00
gss_api.h knfsd: nfsd4: store pseudoflavor in request 2007-07-17 10:23:07 -07:00
gss_asn1.h
gss_err.h
gss_krb5.h
gss_spkm3.h
metrics.h
msg_prot.h SUNRPC: Move universal address definitions to global header 2008-01-30 02:05:50 -05:00
rpc_pipe_fs.h SUNRPC: Add a field to track the number of kernel users of an rpc_pipe 2007-07-10 23:40:33 -04:00
rpc_rdma.h SUNRPC endianness annotations 2007-10-29 07:41:32 -07:00
sched.h Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc 2008-02-01 11:45:47 +11:00
stats.h
svc.h svc: Make deferral processing xprt independent 2008-02-01 16:42:12 -05:00
svc_xprt.h svc: Move the sockaddr information to svc_xprt 2008-02-01 16:42:12 -05:00
svcauth.h knfsd: nfsd: set rq_client to ip-address-determined-domain 2007-07-17 10:23:07 -07:00
svcauth_gss.h knfsd: nfsd4: secinfo handling without secinfo= option 2007-07-17 10:23:08 -07:00
svcsock.h svc: Move the sockaddr information to svc_xprt 2008-02-01 16:42:12 -05:00
timer.h
types.h
xdr.h SUNRPC: Use unsigned string lengths in xdr_decode_string_inplace 2008-02-01 16:42:02 -05:00
xprt.h SUNRPC: fewer conditionals in the format_ip_address routines 2008-01-30 02:06:04 -05:00
xprtrdma.h RPCRDMA: Kconfig and header file with rpcrdma protocol definitions 2007-10-09 17:17:57 -04:00
xprtsock.h SUNRPC: make sunrpc/xprtsock.c:xs_setup_{udp,tcp}() static 2007-11-26 16:24:50 -05:00