[pnfs] [PATCH 19/20] 2.6-latest pnfs client no rpc nfs page cache cleanup

Dean Hildebrand seattleplus at gmail.com
Sun Dec 2 03:17:04 EST 2007


>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index aa40ab2..27b3be5 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -2944,6 +2944,10 @@ static int pnfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
>  	int status;
>  
>  	dprintk("--> %s\n", __func__);
> +
> +	if (data->pnfsflags & PNFS_NO_RPC)
> +		return 0;
> +
>  	status = task->tk_status >= 0 ? 0 : task->tk_status;
>  
>  	/* Is this a DS session */
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index b072ec0..a7d47bc 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -916,6 +916,8 @@ out:
>  
>  /* Post-read completion function.  Invoked by non RPC layout drivers
>   * to clean up read pages.
> + *
> + * NOTE: called must set data->pnfsflags PNFS_NO_RPC
>   */
>  static void
>  pnfs_read_done(struct nfs_read_data* data, ssize_t status, int eof)
> @@ -927,12 +929,17 @@ pnfs_read_done(struct nfs_read_data* data, ssize_t status, int eof)
>  	    pnfs_use_nfsv4_rproto(data->inode, data->args.count))
>  		return;
>  
> -	/* Status is the number of bytes written or an error code */
> +	/* Status is the number of bytes written or an error code
> +	 * the rpc_task is uninitialized, and tk_status is all that
> +	 * is used in the call done routines.
> +	*/
>  	data->task.tk_status = status;
>  	data->res.eof = eof;
>  	data->res.count = status;
> -	pnfs_readpage_result_norpc(&data->task, data);
> -	nfs_readdata_release(data);
> +
> +	/* call the NFS cleanup routines. */
> +	data->call_ops->rpc_call_done(&data->task, data);
> +	data->call_ops->rpc_release(data);
>  }
>   
I think Benny was hinting at this, and I'm not sure if I get it 
completely yet, but it seems that the line above:

data->call_ops->rpc_call_done(&data->task, data);

evaluates to

pnfs4_read_done

which then exists immediately because PNFS_NO_RPC must be set. Is this 
true?  If so, just remove the call to the function.

Dean
>  
>  /*
> diff --git a/fs/nfs/read.c b/fs/nfs/read.c
> index 4cf47c5..1852434 100644
> --- a/fs/nfs/read.c
> +++ b/fs/nfs/read.c
> @@ -381,6 +381,10 @@ static int nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data)
>  	struct nfs_readargs *argp = &data->args;
>  	struct nfs_readres *resp = &data->res;
>  
> +#ifdef CONFIG_PNFS
> +	if (data->pnfsflags & PNFS_NO_RPC)
> +		return 0;
> +#endif /* CONFIG_PNFS */
>  	if (resp->eof || resp->count == argp->count)
>  		return 0;
>  
> diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
> index a6f429b..f747637 100644
> --- a/include/linux/nfs_xdr.h
> +++ b/include/linux/nfs_xdr.h
> @@ -1069,7 +1069,7 @@ struct nfs_read_data {
>  #ifdef CONFIG_PNFS
>  /* pnfsflag values */
>  #define PNFS_ISSYNC		0x0001   /* sync I/O request */
> -#define PNFS_USE_FULL_CB	0x0002   /* non rpc result callback switch */
> +#define PNFS_NO_RPC		0x0002   /* non rpc result callback switch */
>  #endif /* CONFIG_PNFS */
>  
>  struct nfs_write_data {
>   


More information about the pNFS mailing list