Re: [PATCH 3/8] NFS: Introduce nfs4_proc_get_mig_status()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 10, 2011, at 3:14 PM, Chuck Lever wrote:

> 
> On Mar 10, 2011, at 2:58 PM, Trond Myklebust wrote:
> 
>> On Thu, 2011-03-10 at 12:29 -0500, Chuck Lever wrote: 
>>> @@ -5915,6 +5962,37 @@ out:
>>> 	return status;
>>> }
>>> 
>>> +/*
>>> + * Decode migration status probe
>>> + */
>>> +static int nfs4_xdr_dec_get_mig_status(struct rpc_rqst *req,
>>> +				       struct xdr_stream *xdr,
>>> +				       struct nfs4_fs_locations_res *res)
>>> +{
>>> +	struct compound_hdr hdr;
>>> +	int status;
>>> +
>>> +	status = decode_compound_hdr(xdr, &hdr);
>>> +	if (status)
>>> +		goto out;
>>> +	status = decode_sequence(xdr, &res->seq_res, req);
>>> +	if (status)
>>> +		goto out;
>>> +	status = decode_putfh(xdr);
>>> +	if (status)
>>> +		goto out;
>>> +	xdr_enter_page(xdr, PAGE_SIZE);
>>> +	status = decode_getfattr(xdr, &res->fs_locations->fattr,
>>> +				 res->fs_locations->server,
>>> +				 !RPC_IS_ASYNC(req->rq_task));
>>> +	if (status)
>>> +		goto out;
>>> +	if (res->renew)
>>> +		status = decode_renew(xdr);
>>> +out:
>>> +	return status;
>>> +}
>>> +
>>> #if defined(CONFIG_NFS_V4_1)
>>> /*
>>> * Decode EXCHANGE_ID response
>>> @@ -6255,6 +6333,7 @@ struct rpc_procinfo	nfs4_procedures[] = {
>>> 	PROC(GETACL,		enc_getacl,		dec_getacl),
>>> 	PROC(SETACL,		enc_setacl,		dec_setacl),
>>> 	PROC(FS_LOCATIONS,	enc_fs_locations,	dec_fs_locations),
>>> +	PROC(GET_MIG_STATUS,	enc_get_mig_status,	dec_get_mig_status)
>> 
>> Yet more trouble for nfsstat...
> 
> Indeed.
> 
>>> ,
>>> 	PROC(RELEASE_LOCKOWNER,	enc_release_lockowner,	dec_release_lockowner),
>>> #if defined(CONFIG_NFS_V4_1)
>>> 	PROC(EXCHANGE_ID,	enc_exchange_id,	dec_exchange_id),
>> 
>> So looking at what you are doing in GET_MIG_STATUS, it appears to me
>> that
>> 
>> 1) We don't need it for NFSv4.1: the existing fs_locations request just
>> works for that.
> 
>> 2) The only new thing in NFSv4.0 is the renew operation...
> 
> It's true that NFSv4.1 doesn't require a RENEW, but we do still need a new op for migration support.  The original op uses PUTFH;LOOKUP;GETATTR(fs_locations).  We can't use a LOOKUP request to retrieve the fs_locations array for the root directory of an FSID.  So, the new op is substantively different than the original in more ways than the addition of the RENEW.
> 
>> So how about if we just modify the existing fs_locations call to append
>> a RENEW request if/when we supply a clientid?
> 
> I'm willing to think more about this, but I don't see an easy way to reuse the existing fs_locations proc.

On second thought... I can probably switch the behavior of the XDR codecs based on the presence of a dir_fh.  Maybe we can use a single proc here.

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux