From: Tom Tucker <tom@opengridcomputing.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: neilb@suse.de, bfields@fieldses.org, nfs@lists.sourceforge.net,
gnb@sgi.com
Subject: Re: [RFC, PATCH 13/35] svc: Change services to use new svc_create_xprt service
Date: Tue, 02 Oct 2007 11:45:05 -0500 [thread overview]
Message-ID: <1191343505.1565.28.camel@trinity.ogc.int> (raw)
In-Reply-To: <608B3480-525A-43C6-945C-3482CDE823FC@oracle.com>
On Tue, 2007-10-02 at 11:44 -0400, Chuck Lever wrote:
> On Oct 1, 2007, at 3:27 PM, Tom Tucker wrote:
> >
> > Modify the various kernel RPC svcs to use the svc_create_xprt service.
> >
> > Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
> > ---
> >
> > fs/lockd/svc.c | 17 ++++++++---------
> > fs/nfs/callback.c | 4 ++--
> > fs/nfsd/nfssvc.c | 4 ++--
> > include/linux/sunrpc/svcsock.h | 1 -
> > net/sunrpc/sunrpc_syms.c | 1 -
> > net/sunrpc/svcsock.c | 22 ----------------------
> > 6 files changed, 12 insertions(+), 37 deletions(-)
> >
> > diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> > index 82e2192..8686915 100644
> > --- a/fs/lockd/svc.c
> > +++ b/fs/lockd/svc.c
> > @@ -219,13 +219,12 @@ lockd(struct svc_rqst *rqstp)
> > module_put_and_exit(0);
> > }
> >
> > -
> > -static int find_socket(struct svc_serv *serv, int proto)
> > +static int find_xprt(struct svc_serv *serv, char *proto)
> > {
> > struct svc_sock *svsk;
> > int found = 0;
> > list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
> > - if (svsk->sk_sk->sk_protocol == proto) {
> > + if (strcmp(svsk->sk_xprt.xpt_class->xcl_name, proto) == 0) {
> > found = 1;
> > break;
> > }
>
> This is scary. :-)
>
Yes, I agree. In fact, this is the "last place" where svcs ramble around
svc_xprt internals. This was along the lines of "how much bigger do I
make this patchset". BTW, this function was already here , I just
modified it.
> First, I think we would be better off making the server transport API
> stronger by not allowing ULPs to dig around in svc_xprt or the
> svc_xprt_class structures directly. Perhaps you could provide a
> method for obtaining the transport's NETID.
I'll propose a service. NETID or simply protocol/port? What's the
consensus?
>
> Second, is there any guarantee that the string name of the underlying
> protocol is the same as the name of the transport class? Is there
> any relationship between the transport name and the NETIDs it supports?
>
None that are enforced, but that would be cool.
> > @@ -243,13 +242,13 @@ static int make_socks(struct svc_serv *s
> > int err = 0;
> >
> > if (proto == IPPROTO_UDP || nlm_udpport)
> > - if (!find_socket(serv, IPPROTO_UDP))
> > - err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport,
> > - SVC_SOCK_DEFAULTS);
> > + if (!find_xprt(serv, "udp"))
> > + err = svc_create_xprt(serv, "udp", nlm_udpport,
> > + SVC_SOCK_DEFAULTS);
> > if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
> > - if (!find_socket(serv, IPPROTO_TCP))
> > - err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport,
> > - SVC_SOCK_DEFAULTS);
> > + if (!find_xprt(serv, "tcp"))
> > + err = svc_create_xprt(serv, "tcp", nlm_tcpport,
> > + SVC_SOCK_DEFAULTS);
> >
> > if (err >= 0) {
> > warned = 0;
> > diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
> > index a796be5..e27ca14 100644
> > --- a/fs/nfs/callback.c
> > +++ b/fs/nfs/callback.c
> > @@ -123,8 +123,8 @@ int nfs_callback_up(void)
> > if (!serv)
> > goto out_err;
> >
> > - ret = svc_makesock(serv, IPPROTO_TCP, nfs_callback_set_tcpport,
> > - SVC_SOCK_ANONYMOUS);
> > + ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport,
> > + SVC_SOCK_ANONYMOUS);
> > if (ret <= 0)
> > goto out_destroy;
> > nfs_callback_tcpport = ret;
> > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> > index a8c89ae..bf70b06 100644
> > --- a/fs/nfsd/nfssvc.c
> > +++ b/fs/nfsd/nfssvc.c
> > @@ -236,7 +236,7 @@ static int nfsd_init_socks(int port)
> >
> > error = lockd_up(IPPROTO_UDP);
> > if (error >= 0) {
> > - error = svc_makesock(nfsd_serv, IPPROTO_UDP, port,
> > + error = svc_create_xprt(nfsd_serv, "udp", port,
> > SVC_SOCK_DEFAULTS);
> > if (error < 0)
> > lockd_down();
> > @@ -247,7 +247,7 @@ static int nfsd_init_socks(int port)
> > #ifdef CONFIG_NFSD_TCP
> > error = lockd_up(IPPROTO_TCP);
> > if (error >= 0) {
> > - error = svc_makesock(nfsd_serv, IPPROTO_TCP, port,
> > + error = svc_create_xprt(nfsd_serv, "tcp", port,
> > SVC_SOCK_DEFAULTS);
> > if (error < 0)
> > lockd_down();
> > diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/
> > svcsock.h
> > index 9882ce0..3181d9d 100644
> > --- a/include/linux/sunrpc/svcsock.h
> > +++ b/include/linux/sunrpc/svcsock.h
> > @@ -67,7 +67,6 @@ #define SK_LISTENER 11 /* listening en
> > /*
> > * Function prototypes.
> > */
> > -int svc_makesock(struct svc_serv *, int, unsigned short, int flags);
> > void svc_force_close_socket(struct svc_sock *);
> > int svc_recv(struct svc_rqst *, long);
> > int svc_send(struct svc_rqst *);
> > diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
> > index a62ce47..e4cad0f 100644
> > --- a/net/sunrpc/sunrpc_syms.c
> > +++ b/net/sunrpc/sunrpc_syms.c
> > @@ -72,7 +72,6 @@ EXPORT_SYMBOL(svc_drop);
> > EXPORT_SYMBOL(svc_process);
> > EXPORT_SYMBOL(svc_recv);
> > EXPORT_SYMBOL(svc_wake_up);
> > -EXPORT_SYMBOL(svc_makesock);
> > EXPORT_SYMBOL(svc_reserve);
> > EXPORT_SYMBOL(svc_auth_register);
> > EXPORT_SYMBOL(auth_domain_lookup);
> > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> > index e3c74e0..373f020 100644
> > --- a/net/sunrpc/svcsock.c
> > +++ b/net/sunrpc/svcsock.c
> > @@ -2012,28 +2012,6 @@ void svc_force_close_socket(struct svc_s
> > svc_close_socket(svsk);
> > }
> >
> > -/**
> > - * svc_makesock - Make a socket for nfsd and lockd
> > - * @serv: RPC server structure
> > - * @protocol: transport protocol to use
> > - * @port: port to use
> > - * @flags: requested socket characteristics
> > - *
> > - */
> > -int svc_makesock(struct svc_serv *serv, int protocol, unsigned
> > short port,
> > - int flags)
> > -{
> > - dprintk("svc: creating socket proto = %d\n", protocol);
> > - switch (protocol) {
> > - case IPPROTO_TCP:
> > - return svc_create_xprt(serv, "tcp", port, flags);
> > - case IPPROTO_UDP:
> > - return svc_create_xprt(serv, "udp", port, flags);
> > - default:
> > - return -EINVAL;
> > - }
> > -}
> > -
> > /*
> > * Handle defer and revisit of requests
> > */
>
> Chuck Lever
> chuck.lever@oracle.com
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2007-10-02 16:52 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-01 19:14 [RFC,PATCH 00/35] SVC Transport Switch Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 01/35] svc: Add an svc transport class Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 02/35] svc: Make svc_sock the tcp/udp transport Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 03/35] svc: Change the svc_sock in the rqstp structure to a transport Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 04/35] svc: Add a max payload value to the transport Tom Tucker
2007-10-02 14:54 ` Chuck Lever
2007-10-02 16:28 ` Tom Tucker
2007-10-03 11:09 ` Greg Banks
2007-10-03 14:26 ` Tom Tucker
2007-10-03 15:18 ` Chuck Lever
2007-10-04 1:10 ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 05/35] svc: Move sk_sendto and sk_recvfrom to svc_xprt_class Tom Tucker
2007-10-02 15:04 ` Chuck Lever
2007-10-02 16:29 ` Tom Tucker
2007-10-02 16:57 ` Chuck Lever
2007-10-02 18:24 ` Tom Tucker
2007-10-02 18:30 ` Tom Tucker
2007-10-02 18:47 ` Chuck Lever
2007-10-02 19:55 ` Tom Tucker
2007-10-02 20:29 ` Chuck Lever
2007-10-02 20:35 ` Tom Tucker
2007-10-02 20:38 ` Tom Tucker
2007-10-04 1:34 ` Greg Banks
2007-10-04 1:21 ` Greg Banks
2007-10-03 11:13 ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 06/35] svc: Add transport specific xpo_release function Tom Tucker
2007-10-02 15:18 ` Chuck Lever
2007-10-02 16:35 ` Tom Tucker
2007-10-04 1:48 ` Greg Banks
2007-10-01 19:27 ` [RFC,PATCH 07/35] svc: Add per-transport delete functions Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 08/35] svc: Add xpo_prep_reply_hdr Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 09/35] svc: Add a transport function that checks for write space Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 10/35] svc: Move close processing to a single place Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 11/35] svc: Add xpo_accept transport function Tom Tucker
2007-10-02 15:33 ` Chuck Lever
2007-10-02 16:41 ` Tom Tucker
2007-10-02 17:07 ` Chuck Lever
2007-10-02 18:28 ` Tom Tucker
2007-10-02 18:49 ` Chuck Lever
2007-10-04 1:54 ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 12/35] svc: Add a generic transport svc_create_xprt function Tom Tucker
2007-10-02 15:39 ` Chuck Lever
2007-10-03 20:01 ` Tom Tucker
2007-10-03 20:04 ` Tom Tucker
2007-10-04 2:30 ` Greg Banks
2007-10-04 15:18 ` Chuck Lever
2007-10-01 19:27 ` [RFC, PATCH 13/35] svc: Change services to use new svc_create_xprt service Tom Tucker
2007-10-02 15:44 ` Chuck Lever
2007-10-02 16:45 ` Tom Tucker [this message]
2007-10-03 15:25 ` Chuck Lever
2007-10-03 16:23 ` Tom Tucker
2007-10-04 2:35 ` Greg Banks
2007-10-04 14:27 ` Tom Tucker
2007-10-09 17:09 ` J. Bruce Fields
2007-10-09 18:32 ` Tom Tucker
2007-10-09 19:49 ` J. Bruce Fields
2007-10-09 20:19 ` J. Bruce Fields
2007-10-01 19:28 ` [RFC,PATCH 14/35] svc: Change sk_inuse to a kref Tom Tucker
2007-10-03 11:12 ` Christoph Hellwig
2007-10-03 14:39 ` Tom Tucker
2007-10-03 14:45 ` J. Bruce Fields
2007-10-03 14:52 ` Christoph Hellwig
2007-10-03 15:11 ` J. Bruce Fields
2007-10-03 15:15 ` Christoph Hellwig
2007-10-08 3:52 ` Neil Brown
2007-10-03 15:13 ` Chuck Lever
2007-10-03 15:34 ` J. Bruce Fields
2007-10-04 2:51 ` Greg Banks
2007-10-01 19:28 ` [RFC, PATCH 15/35] svc: Move sk_flags to the svc_xprt structure Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 16/35] svc: Move sk_server and sk_pool to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 17/35] svc: Make close transport independent Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 18/35] svc: Move sk_reserved to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 19/35] svc: Make the enqueue service transport neutral and export it Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 20/35] svc: Make svc_send transport neutral Tom Tucker
2007-10-02 16:15 ` Chuck Lever
2007-10-02 16:46 ` Tom Tucker
2007-10-02 16:54 ` Chuck Lever
2007-10-04 2:59 ` Greg Banks
2007-10-01 19:28 ` [RFC, PATCH 21/35] svc: Change svc_sock_received to svc_xprt_received and export it Tom Tucker
2007-10-02 16:18 ` Chuck Lever
2007-10-01 19:28 ` [RFC,PATCH 22/35] svc: Remove sk_lastrecv Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 23/35] svc: Move the authinfo cache to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 24/35] svc: Make deferral processing xprt independent Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 25/35] svc: Move the sockaddr information to svc_xprt Tom Tucker
2007-10-02 16:34 ` Chuck Lever
2007-10-02 16:50 ` Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 26/35] svc: Make svc_sock_release svc_xprt_release Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 27/35] svc: Make svc_recv transport neutral Tom Tucker
2007-10-02 16:36 ` Chuck Lever
2007-10-01 19:28 ` [RFC, PATCH 28/35] svc: Make svc_age_temp_sockets svc_age_temp_transports Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 29/35] svc: Move common create logic to common code Tom Tucker
2007-10-02 16:42 ` Chuck Lever
2007-10-02 16:51 ` Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 30/35] svc: Removing remaining references to rq_sock in rqstp Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 31/35] svc: Make svc_check_conn_limits xprt independent Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 32/35] svc: Move the xprt independent code to the svc_xprt.c file Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 33/35] svc: Add transport hdr size for defer/revisit Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 34/35] svc: Add /proc/sys/sunrpc/transport files Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 35/35] knfsd: Support adding transports by writing portlist file Tom Tucker
2007-10-02 15:25 ` [RFC,PATCH 00/35] SVC Transport Switch J. Bruce Fields
2007-10-02 16:18 ` Tom Tucker
2007-10-03 11:03 ` Greg Banks
2007-10-03 14:02 ` Tom Tucker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1191343505.1565.28.camel@trinity.ogc.int \
--to=tom@opengridcomputing.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=gnb@sgi.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.