Re: [pnfs] [RFC 01/11] nfsd: introduce nfs4_client state

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

 



Benny Halevy wrote:
> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
> ---
>  fs/nfsd/state.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
> index fefeae2..7e67eca 100644
> --- a/fs/nfsd/state.h
> +++ b/fs/nfsd/state.h
> @@ -186,6 +186,13 @@ struct nfsd4_sessionid {
>  
>  #define HEXDIR_LEN     33 /* hex version of 16 byte md5 of cl_name plus '\0' */
>  
> +/* nfs4_client states */
> +enum nfs4_client_state {
> +	CL_STATE_NORMAL,
> +	CL_STATE_RENEW,
> +	CL_STATE_EXPIRED,
> +};
> +
>  /*
>   * struct nfs4_client - one per client.  Clientids live here.
>   * 	o Each nfs4_client is hashed by clientid.
> @@ -214,6 +221,7 @@ struct nfs4_client {
>  	nfs4_verifier		cl_confirm;	/* generated by server */
>  	struct nfs4_cb_conn	cl_cb_conn;     /* callback info */
>  	atomic_t		cl_count;	/* ref count */
> +	atomic_t		cl_state;	/* renew / expiry state */

The use of an atomic here seems complex and makes the
implementation seem fragile to me.  Is the atomic_cmpxchg()
really going to save much time over just using a spinlock
and normal loads and stores to retrieve and get the value
of cl_state?  A spinlock would make things much more
obvious how they were supposed to work, to me, at least.

	Thanx...

		ps

>  	u32			cl_firststate;	/* recovery dir creation */
>  
>  	/* for nfs41 */

--
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