Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Chuck Lever <chucklever@gmail.com>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 18/25] NFS: Convert NFS client to use new rpc_create()	API
Date: Wed, 09 Aug 2006 11:30:12 -0400	[thread overview]
Message-ID: <1155137413.5731.87.camel@localhost> (raw)
In-Reply-To: <20060809145933.3914.19856.stgit@picasso.dsl.sfldmi.ameritech.net>

Has no chance of applying 'cos it is based on the 2.6.18-rc tree. Please
pull from the NFS git tree.

Cheers,
  Trond

On Wed, 2006-08-09 at 10:59 -0400, Chuck Lever wrote:
> Convert NFS client mount logic to use rpc_create() instead of the old
> xprt_create_proto/rpc_create_client API.
> 
> Test plan:
> Mount stress tests.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  fs/nfs/mount_clnt.c |   29 +++++++++-----------
>  fs/nfs/super.c      |   74 +++++++++++++++++++++++----------------------------
>  2 files changed, 46 insertions(+), 57 deletions(-)
> 
> diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
> index 4127487..ef8a3a0 100644
> --- a/fs/nfs/mount_clnt.c
> +++ b/fs/nfs/mount_clnt.c
> @@ -76,22 +76,19 @@ static struct rpc_clnt *
>  mnt_create(char *hostname, struct sockaddr_in *srvaddr, int version,
>  		int protocol)
>  {
> -	struct rpc_xprt	*xprt;
> -	struct rpc_clnt	*clnt;
> -
> -	xprt = xprt_create_proto(protocol, srvaddr, NULL);
> -	if (IS_ERR(xprt))
> -		return (struct rpc_clnt *)xprt;
> -
> -	clnt = rpc_create_client(xprt, hostname,
> -				&mnt_program, version,
> -				RPC_AUTH_UNIX);
> -	if (!IS_ERR(clnt)) {
> -		clnt->cl_softrtry = 1;
> -		clnt->cl_oneshot  = 1;
> -		clnt->cl_intr = 1;
> -	}
> -	return clnt;
> +	struct rpc_create_args args = {
> +		.protocol	= protocol,
> +		.address	= (struct sockaddr *)srvaddr,
> +		.addrsize	= sizeof(*srvaddr),
> +		.servername	= hostname,
> +		.program	= &mnt_program,
> +		.version	= version,
> +		.authflavor	= RPC_AUTH_UNIX,
> +		.flags		= (RPC_CLNT_CREATE_ONESHOT |
> +				   RPC_CLNT_INTR),
> +	};
> +
> +	return rpc_create(&args);
>  }
>  
>  /*
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index e8a9bee..8daccf6 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -685,37 +685,29 @@ static void nfs_init_timeout_values(stru
>  static struct rpc_clnt *
>  nfs_create_client(struct nfs_server *server, const struct nfs_mount_data *data)
>  {
> +	struct rpc_clnt		*clnt;
>  	struct rpc_timeout	timeparms;
> -	struct rpc_xprt		*xprt = NULL;
> -	struct rpc_clnt		*clnt = NULL;
> -	int			proto = (data->flags & NFS_MOUNT_TCP) ? IPPROTO_TCP : IPPROTO_UDP;
> -
> -	nfs_init_timeout_values(&timeparms, proto, data->timeo, data->retrans);
> +	struct rpc_create_args args = {
> +		.protocol	= ((data->flags & NFS_MOUNT_TCP) ?
> +						IPPROTO_TCP : IPPROTO_UDP),
> +		.address	= (struct sockaddr *)&server->addr,
> +		.addrsize	= sizeof(server->addr),
> +		.timeout	= &timeparms,
> +		.servername	= server->hostname,
> +		.program	= &nfs_program,
> +		.version	= server->rpc_ops->version,
> +		.authflavor	= data->pseudoflavor,
> +	};
>  
> +	nfs_init_timeout_values(&timeparms, args.protocol,
> +					data->timeo, data->retrans);
>  	server->retrans_timeo = timeparms.to_initval;
>  	server->retrans_count = timeparms.to_retries;
>  
> -	/* create transport and client */
> -	xprt = xprt_create_proto(proto, &server->addr, &timeparms);
> -	if (IS_ERR(xprt)) {
> -		dprintk("%s: cannot create RPC transport. Error = %ld\n",
> -				__FUNCTION__, PTR_ERR(xprt));
> -		return (struct rpc_clnt *)xprt;
> -	}
> -	clnt = rpc_create_client(xprt, server->hostname, &nfs_program,
> -				 server->rpc_ops->version, data->pseudoflavor);
> -	if (IS_ERR(clnt)) {
> +	clnt = rpc_create(&args);
> +	if (IS_ERR(clnt))
>  		dprintk("%s: cannot create RPC client. Error = %ld\n",
> -				__FUNCTION__, PTR_ERR(xprt));
> -		goto out_fail;
> -	}
> -
> -	clnt->cl_intr     = 1;
> -	clnt->cl_softrtry = 1;
> -
> -	return clnt;
> -
> -out_fail:
> +				__FUNCTION__, PTR_ERR(clnt));
>  	return clnt;
>  }
>  
> @@ -1122,11 +1114,14 @@ static int nfs_clone_nfs_sb(struct file_
>  }
>  
>  #ifdef CONFIG_NFS_V4
> +/*
> + * NB: nfs4_kill_super takes care of reaping the rpc_clnt if something
> + *     here fails.
> + */
>  static struct rpc_clnt *nfs4_create_client(struct nfs_server *server,
>  	struct rpc_timeout *timeparms, int proto, rpc_authflavor_t flavor)
>  {
>  	struct nfs4_client *clp;
> -	struct rpc_xprt *xprt = NULL;
>  	struct rpc_clnt *clnt = NULL;
>  	int err = -EIO;
>  
> @@ -1136,21 +1131,20 @@ static struct rpc_clnt *nfs4_create_clie
>  		return ERR_PTR(err);
>  	}
>  
> -	/* Now create transport and client */
>  	down_write(&clp->cl_sem);
>  	if (IS_ERR(clp->cl_rpcclient)) {
> -		xprt = xprt_create_proto(proto, &server->addr, timeparms);
> -		if (IS_ERR(xprt)) {
> -			up_write(&clp->cl_sem);
> -			err = PTR_ERR(xprt);
> -			dprintk("%s: cannot create RPC transport. Error = %d\n",
> -					__FUNCTION__, err);
> -			goto out_fail;
> -		}
> -		/* Bind to a reserved port! */
> -		xprt->resvport = 1;
> -		clnt = rpc_create_client(xprt, server->hostname, &nfs_program,
> -				server->rpc_ops->version, flavor);
> +		struct rpc_create_args args = {
> +			.protocol	= proto,
> +			.address	= (struct sockaddr *)&server->addr,
> +			.addrsize	= sizeof(server->addr),
> +			.timeout	= timeparms,
> +			.servername	= server->hostname,
> +			.program	= &nfs_program,
> +			.version	= server->rpc_ops->version,
> +			.authflavor	= flavor,
> +		};
> +
> +		clnt = rpc_create(&args);
>  		if (IS_ERR(clnt)) {
>  			up_write(&clp->cl_sem);
>  			err = PTR_ERR(clnt);
> @@ -1158,8 +1152,6 @@ static struct rpc_clnt *nfs4_create_clie
>  					__FUNCTION__, err);
>  			goto out_fail;
>  		}
> -		clnt->cl_intr     = 1;
> -		clnt->cl_softrtry = 1;
>  		clp->cl_rpcclient = clnt;
>  		memcpy(clp->cl_ipaddr, server->ip_addr, sizeof(clp->cl_ipaddr));
>  		nfs_idmap_new(clp);


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2006-08-09 15:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 14:47 [PATCH 00/25] RPC client transport switch, continued Chuck Lever
2006-08-09 14:58 ` [PATCH 01/25] SUNRPC: avoid choosing an IPMI port for RPC traffic Chuck Lever
2006-08-09 15:04   ` Christoph Hellwig
2006-08-09 14:58 ` [PATCH 02/25] SUNRPC: Create a helper to tell whether a transport is bound Chuck Lever
2006-08-09 15:19   ` Trond Myklebust
2006-08-09 15:27     ` Chuck Lever
2006-08-09 15:37       ` Trond Myklebust
2006-08-09 14:58 ` [PATCH 03/25] SUNRPC: Make RPC portmapper use per-transport storage Chuck Lever
2006-08-09 14:58 ` [PATCH 04/25] SUNRPC: Clean-up after recent changes to sunrpc/pmap_clnt.c Chuck Lever
2006-08-09 14:59 ` [PATCH 05/25] SUNRPC: Support for RPC child tasks no longer needed Chuck Lever
2006-08-09 14:59 ` [PATCH 06/25] SUNRPC: Introduce transport switch callout for pluggable rpcbind Chuck Lever
2006-08-09 14:59 ` [PATCH 07/25] SUNRPC: create API for getting remote peer address Chuck Lever
2006-08-09 15:06   ` Christoph Hellwig
2006-08-09 14:59 ` [PATCH 08/25] LOCKD: Teach lockd to use the new rpc_peeraddr() API Chuck Lever
2006-08-09 14:59 ` [PATCH 09/25] SUNRPC: Teach the RPC portmapper " Chuck Lever
2006-08-09 14:59 ` [PATCH 10/25] SUNRPC: remove extraneous header inclusions Chuck Lever
2006-08-09 14:59 ` [PATCH 11/25] SUNRPC: add xprt switch API for printing formatted remote peer addresses Chuck Lever
2006-08-09 14:59 ` [PATCH 12/25] SUNRPC: Create API for displaying remote peer address Chuck Lever
2006-08-09 14:59 ` [PATCH 13/25] SUNRPC: Teach rpc_pipe.c to use new rpc_peeraddr() API Chuck Lever
2006-08-09 14:59 ` [PATCH 14/25] SUNRPC: Use "sockaddr_storage" for storing RPC client's remote peer address Chuck Lever
2006-08-09 14:59 ` [PATCH 15/25] SUNRPC: Clean-up after previous patches Chuck Lever
2006-08-09 14:59 ` [PATCH 16/25] SUNRPC: use sockaddr + size when creating remote transport endpoints Chuck Lever
2006-08-09 14:59 ` [PATCH 17/25] LOCKD: Convert to use new rpc_create() API Chuck Lever
2006-08-09 14:59 ` [PATCH 18/25] NFS: Convert NFS client " Chuck Lever
2006-08-09 15:30   ` Trond Myklebust [this message]
2006-08-09 14:59 ` [PATCH 19/25] NFSD: Convert NFS server callback logic to use new rpc_create API Chuck Lever
2006-08-09 14:59 ` [PATCH 20/25] SUNRPC: Convert RPC portmapper to use new rpc_create() API Chuck Lever
2006-08-09 14:59 ` [PATCH 21/25] SUNRPC: Eliminate xprt_create_proto and rpc_create_client Chuck Lever
2006-08-09 14:59 ` [PATCH 22/25] NFS: remove a no-longer-needed error check in nfs_symlink() Chuck Lever
2006-08-10  2:10   ` Greg Banks
2006-08-10 12:36     ` Peter Staubach
2006-08-09 14:59 ` [PATCH 23/25] NFS: Fix double d_drop in nfs_instantiate() error path Chuck Lever
2006-08-09 15:34   ` Trond Myklebust
2006-08-09 14:59 ` [PATCH 24/25] NFS: copy symlinks into page cache before sending NFS SYMLINK request Chuck Lever
2006-08-09 14:59 ` [PATCH 25/25] NFS: Use cached page as buffer for NFS symlink requests Chuck Lever

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=1155137413.5731.87.camel@localhost \
    --to=trond.myklebust@fys.uio.no \
    --cc=chucklever@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox