linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 4/4] NFS: Move cl_delegations to the nfs_server struct
Date: Thu, 23 Dec 2010 17:09:42 -0500	[thread overview]
Message-ID: <1293142182.9718.3.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20101223215444.2344.27617.stgit@matisse.1015granger.net>

On Thu, 2010-12-23 at 16:54 -0500, Chuck Lever wrote:
> Delegations are per-inode, not per-nfs_client.  When a server file
> system is migrated, delegations on the client must be moved from the
> source to the destination nfs_server.  Make it easier to manage a
> mount point's delegation list across a migration event by moving the
> list to the nfs_server struct.
> 
> Clean up: I added documenting comments to public functions I changed
> in this patch.  For consistency I added comments to all the other
> public functions in fs/nfs/delegation.c.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  fs/nfs/client.c           |    4 -
>  fs/nfs/delegation.c       |  337 +++++++++++++++++++++++++++++++++------------
>  fs/nfs/delegation.h       |    1 
>  fs/nfs/nfs4renewd.c       |    2 
>  include/linux/nfs_fs_sb.h |    2 
>  5 files changed, 253 insertions(+), 93 deletions(-)
> 
> diff --git a/fs/nfs/client.c b/fs/nfs/client.c
> index 05e2ee2..d112887 100644
> --- a/fs/nfs/client.c
> +++ b/fs/nfs/client.c
> @@ -144,7 +144,6 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
>  	clp->cl_proto = cl_init->proto;
>  
>  #ifdef CONFIG_NFS_V4
> -	INIT_LIST_HEAD(&clp->cl_delegations);
>  	spin_lock_init(&clp->cl_lock);
>  	INIT_DELAYED_WORK(&clp->cl_renewd, nfs4_renew_state);
>  	rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client");
> @@ -1025,6 +1024,9 @@ static struct nfs_server *nfs_alloc_server(void)
>  	/* Zero out the NFS state stuff */
>  	INIT_LIST_HEAD(&server->client_link);
>  	INIT_LIST_HEAD(&server->master_link);
> +#ifdef CONFIG_NFS_V4
> +	INIT_LIST_HEAD(&server->delegations);
> +#endif

As I said earlier, can we please avoid this? Just define the
'delegations' field unconditionally in struct nfs_server, and get rid of
the CONFIG_NFS_V4 above.

Cheers
  Trond

>  	atomic_set(&server->active, 0);


 
> diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
> index e96ec55..2ddf7aa 100644
> --- a/include/linux/nfs_fs_sb.h
> +++ b/include/linux/nfs_fs_sb.h
> @@ -47,7 +47,6 @@ struct nfs_client {
>  	u64			cl_clientid;	/* constant */
>  	unsigned long		cl_state;
>  
> -	struct list_head	cl_delegations;
>  	spinlock_t		cl_lock;
>  
>  	unsigned long		cl_lease_time;
> @@ -149,6 +148,7 @@ struct nfs_server {
>  	struct rb_root		state_owners;
>  	struct rb_root		openowner_id;
>  	struct rb_root		lockowner_id;
> +	struct list_head	delegations;
>  #endif
>  	void (*destroy)(struct nfs_server *);
>  
> 

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


  reply	other threads:[~2010-12-23 22:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23 21:54 [PATCH 0/4] Refactor data structures to support NFSv4 migration Chuck Lever
2010-12-23 21:54 ` [PATCH 1/4] NFS: Allow walking nfs_client.cl_superblocks list outside client.c Chuck Lever
2010-12-23 21:54 ` [PATCH 2/4] NFS: Move cl_state_owners and related fields to the nfs_server struct Chuck Lever
2010-12-23 22:04   ` Trond Myklebust
2010-12-23 22:49     ` Chuck Lever
2010-12-23 23:27       ` Trond Myklebust
2010-12-23 21:54 ` [PATCH 3/4] NFS: Introduce nfs_detach_delegations() Chuck Lever
2010-12-23 21:54 ` [PATCH 4/4] NFS: Move cl_delegations to the nfs_server struct Chuck Lever
2010-12-23 22:09   ` Trond Myklebust [this message]
     [not found]     ` <1293142182.9718.3.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-12-23 22:14       ` Chuck Lever
  -- strict thread matches above, loose matches on Subject: below --
2010-12-24  1:32 [PATCH 0/4] Refactor data structures to support NFSv4 migration (2) Chuck Lever
2010-12-24  1:33 ` [PATCH 4/4] NFS: Move cl_delegations to the nfs_server struct Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1293142182.9718.3.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).