[pnfs] [PATCH 02/10] pnfs: Ensure pdata is only defined for pnfs

Benny Halevy bhalevy at panasas.com
Wed Jul 9 03:26:02 EDT 2008


On Jul. 09, 2008, 0:53 +0300, Dean Hildebrand <seattleplus at gmail.com> wrote:
> Signed-off-by: Dean Hildebrand <dhildeb at us.ibm.com>
> ---
>  fs/nfs/read.c  |    2 ++
>  fs/nfs/write.c |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfs/read.c b/fs/nfs/read.c
> index d78c0f9..31b4c40 100644
> --- a/fs/nfs/read.c
> +++ b/fs/nfs/read.c
> @@ -223,8 +223,10 @@ static int nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
>  	nfs_fattr_init(&data->fattr);
>  
>  	ret = pnfs_try_to_read_data(data, call_ops);
> +#if defined(CONFIG_PNFS)

Sigh, I was hoping to avoid this...

If we do end up using #ifdef here it's worth covering the call
to pnfs_try_to_* as well (yeah, and "ret" should be defined for this
context only so the compiler won't get annoyed about not using it)

>  	if (ret == 0)
>  		return data->pdata.pnfs_error;
> +#endif /* CONFIG_PNFS */
>  
>  	return nfs_initiate_read(data, NFS_CLIENT(inode), call_ops);
>  }
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 632f476..ff97ccf 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -867,8 +867,10 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
>  	nfs_fattr_init(&data->fattr);
>  
>  	ret = pnfs_try_to_write_data(data, call_ops, how);
> +#if defined(CONFIG_PNFS)
>  	if (ret == 0)
>  		return data->pdata.pnfs_error;
> +#endif /* CONFIG_PNFS */
>  
>  	return nfs_initiate_write(data, NFS_CLIENT(inode), call_ops, how);
>  }



More information about the pNFS mailing list