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

Dean Hildebrand seattleplus at gmail.com
Thu Jul 10 01:05:53 EDT 2008



Benny Halevy wrote:
> 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)
>   
I guess.  The other options are:
a) un ifdef'ing pnfs_error
b) Remove pnfs_error alltogether and return the error directly from 
try_to_xxx (ret <=0 means we did pnfs, ret == 1 means try nfs).  I think 
you mention this in another email about being unlikeable, but it might 
be ok if we do it for every try_to_xxx.
Dean
>   
>>  	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