public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: trond.myklebust@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/8] SUNRPC: Add address family field to svc_serv data structure
Date: Thu, 3 Jul 2008 17:14:23 -0400	[thread overview]
Message-ID: <20080703211423.GL30918@fieldses.org> (raw)
In-Reply-To: <20080630224529.24887.47412.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>

On Mon, Jun 30, 2008 at 06:45:30PM -0400, Chuck Lever wrote:
> Introduce and initialize an address family field in the svc_serv structure.
> 
> This field will determine what family to use for the service's listener
> sockets and what families are advertised via the local rpcbind daemon.

Possibly dumb question: so it never makes sense to listen on sockets
with both address families?

--b.

> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  fs/lockd/svc.c             |    2 +-
>  fs/nfs/callback.c          |    3 ++-
>  fs/nfsd/nfssvc.c           |    1 +
>  include/linux/sunrpc/svc.h |    7 ++++---
>  net/sunrpc/svc.c           |   11 ++++++-----
>  5 files changed, 14 insertions(+), 10 deletions(-)
> 
> 
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 2169af4..51bccee 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -276,7 +276,7 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
>  			"lockd_up: no pid, %d users??\n", nlmsvc_users);
>  
>  	error = -ENOMEM;
> -	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);
> +	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, AF_INET, NULL);
>  	if (!serv) {
>  		printk(KERN_WARNING "lockd_up: create service failed\n");
>  		goto out;
> diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
> index f447f4b..6a09760 100644
> --- a/fs/nfs/callback.c
> +++ b/fs/nfs/callback.c
> @@ -105,7 +105,8 @@ int nfs_callback_up(void)
>  	mutex_lock(&nfs_callback_mutex);
>  	if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)
>  		goto out;
> -	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, NULL);
> +	serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
> +				AF_INET, NULL);
>  	ret = -ENOMEM;
>  	if (!serv)
>  		goto out_err;
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 941041f..f38f47a 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -219,6 +219,7 @@ int nfsd_create_serv(void)
>  	atomic_set(&nfsd_busy, 0);
>  	nfsd_serv = svc_create_pooled(&nfsd_program,
>  				      nfsd_max_blksize,
> +				      AF_INET,
>  				      nfsd_last_thread,
>  				      nfsd, SIG_NOCLEAN, THIS_MODULE);
>  	if (nfsd_serv == NULL)
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index 4b54c5f..a27178b 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -66,6 +66,7 @@ struct svc_serv {
>  	struct list_head	sv_tempsocks;	/* all temporary sockets */
>  	int			sv_tmpcnt;	/* count of temporary sockets */
>  	struct timer_list	sv_temptimer;	/* timer for aging temporary sockets */
> +	sa_family_t		sv_family;	/* listener's address family */
>  
>  	char *			sv_name;	/* service name */
>  
> @@ -382,13 +383,13 @@ struct svc_procedure {
>  /*
>   * Function prototypes.
>   */
> -struct svc_serv *  svc_create(struct svc_program *, unsigned int,
> -			      void (*shutdown)(struct svc_serv*));
> +struct svc_serv *svc_create(struct svc_program *, unsigned int, sa_family_t,
> +					void (*shutdown)(struct svc_serv *));
>  struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
>  					struct svc_pool *pool);
>  void		   svc_exit_thread(struct svc_rqst *);
>  struct svc_serv *  svc_create_pooled(struct svc_program *, unsigned int,
> -			void (*shutdown)(struct svc_serv*),
> +			sa_family_t, void (*shutdown)(struct svc_serv *),
>  			svc_thread_fn, int sig, struct module *);
>  int		   svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
>  void		   svc_destroy(struct svc_serv *);
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 01c7e31..d0e7865 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -366,7 +366,7 @@ svc_pool_for_cpu(struct svc_serv *serv, int cpu)
>   */
>  static struct svc_serv *
>  __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
> -	   void (*shutdown)(struct svc_serv *serv))
> +	   sa_family_t family, void (*shutdown)(struct svc_serv *serv))
>  {
>  	struct svc_serv	*serv;
>  	unsigned int vers;
> @@ -375,6 +375,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
>  
>  	if (!(serv = kzalloc(sizeof(*serv), GFP_KERNEL)))
>  		return NULL;
> +	serv->sv_family    = family;
>  	serv->sv_name      = prog->pg_name;
>  	serv->sv_program   = prog;
>  	serv->sv_nrthreads = 1;
> @@ -434,21 +435,21 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
>  
>  struct svc_serv *
>  svc_create(struct svc_program *prog, unsigned int bufsize,
> -		void (*shutdown)(struct svc_serv *serv))
> +		sa_family_t family, void (*shutdown)(struct svc_serv *serv))
>  {
> -	return __svc_create(prog, bufsize, /*npools*/1, shutdown);
> +	return __svc_create(prog, bufsize, /*npools*/1, family, shutdown);
>  }
>  EXPORT_SYMBOL(svc_create);
>  
>  struct svc_serv *
>  svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
> -		void (*shutdown)(struct svc_serv *serv),
> +		  sa_family_t family, void (*shutdown)(struct svc_serv *serv),
>  		  svc_thread_fn func, int sig, struct module *mod)
>  {
>  	struct svc_serv *serv;
>  	unsigned int npools = svc_pool_map_get();
>  
> -	serv = __svc_create(prog, bufsize, npools, shutdown);
> +	serv = __svc_create(prog, bufsize, npools, family, shutdown);
>  
>  	if (serv != NULL) {
>  		serv->sv_function = func;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-07-03 21:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-30 22:45 [PATCH 0/8] rpcbind v4 support in net/sunrpc/svc* Chuck Lever
     [not found] ` <20080630224147.24887.18730.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-06-30 22:45   ` [PATCH 1/8] SUNRPC: Add address family field to svc_serv data structure Chuck Lever
     [not found]     ` <20080630224529.24887.47412.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-03 21:14       ` J. Bruce Fields [this message]
2008-07-04 13:45         ` Chuck Lever
2008-06-30 22:45   ` [PATCH 2/8] SUNRPC: Use proper INADDR_ANY when setting up RPC services on IPv6 Chuck Lever
2008-06-30 22:45   ` [PATCH 3/8] SUNRPC: Split portmap unregister API into separate function Chuck Lever
     [not found]     ` <20080630224545.24887.61618.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-18 23:21       ` J. Bruce Fields
2008-07-21  3:17         ` Chuck Lever
     [not found]           ` <76bd70e30807202017hec9d1der1bbbf5c5dcedac45-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-23 16:58             ` J. Bruce Fields
2008-06-30 22:45   ` [PATCH 4/8] SUNRPC: Clean up svc_register Chuck Lever
     [not found]     ` <20080630224553.24887.73617.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-18 23:29       ` J. Bruce Fields
2008-07-21 19:24         ` Chuck Lever
2008-06-30 22:46   ` [PATCH 5/8] SUNRPC: Use new rpcb_v4_register() interface in svc_register() Chuck Lever
     [not found]     ` <20080630224601.24887.59241.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-18 23:40       ` J. Bruce Fields
2008-07-21 19:26         ` Chuck Lever
2008-06-30 22:46   ` [PATCH 6/8] SUNRPC: Add kernel build option to disable server-side use of rpcbind v3/v4 Chuck Lever
     [not found]     ` <20080630224609.24887.20585.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-18 23:42       ` J. Bruce Fields
2008-07-21 19:30         ` Chuck Lever
     [not found]           ` <76bd70e30807211230y4b7c2b21qa89d8cca05e08dab-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-30 16:18             ` J. Bruce Fields
2008-06-30 22:46   ` [PATCH 7/8] SUNRPC: Set V6ONLY socket option for RPC listener sockets Chuck Lever
     [not found]     ` <20080630224616.24887.13171.stgit-ewv44WTpT0t9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2008-07-19  1:05       ` J. Bruce Fields
2008-07-21 19:32         ` Chuck Lever
2008-06-30 22:46   ` [PATCH 8/8] NFS: Enable NFSv4 callback server to listen on AF_INET6 sockets Chuck Lever
2008-07-19  1:07   ` [PATCH 0/8] rpcbind v4 support in net/sunrpc/svc* J. Bruce Fields
2008-07-20 21:17     ` J. Bruce Fields
2008-07-21 19:07       ` Chuck Lever
     [not found]         ` <76bd70e30807211207q4fc509e0h4a1a560fe8097de7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-23 21:53           ` J. Bruce Fields
2008-07-23 22:47             ` Chuck Lever
     [not found]               ` <76bd70e30807231547j19e9fd8dv7a14c2795226dcd6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-23 23:05                 ` Trond Myklebust

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=20080703211423.GL30918@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox