linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Schumaker, Anna" <Anna.Schumaker@netapp.com>
To: "buczek@molgen.mpg.de" <buczek@molgen.mpg.de>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"trond.myklebust@hammerspace.com"
	<trond.myklebust@hammerspace.com>
Subject: Re: [PATCH 3/4 RESEND] nfs4: Move nfs4_setup_state_renewal
Date: Fri, 28 Jun 2019 18:29:47 +0000	[thread overview]
Message-ID: <4a732990d3f2797591fb79ef0b04983a17a16c6e.camel@netapp.com> (raw)
In-Reply-To: <20190628123640.8715-4-buczek@molgen.mpg.de>

Hi Donald,

On Fri, 2019-06-28 at 14:36 +0200, Donald Buczek wrote:
> The function nfs4_setup_state_renewal is to be used by
> nfs4_init_clientid. Move it further to the top of the source file to
> include it regardles of CONFIG_NFS_V4_1 and to save a forward
> declaration. No code changed.
> 
> Signed-off-by: Donald Buczek <buczek@molgen.mpg.de>
> ---
>  fs/nfs/nfs4state.c | 42 +++++++++++++++++++++---------------------
>  1 file changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 778ebfb00d13..c2df257f426f 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -87,6 +87,27 @@ const nfs4_stateid current_stateid = {
>  
>  static DEFINE_MUTEX(nfs_clid_init_mutex);
>  
> +static int nfs4_setup_state_renewal(struct nfs_client *clp)
> +{
> +	int status;
> +	struct nfs_fsinfo fsinfo;
> +	unsigned long now;
> +
> +	if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) {
> +		nfs4_schedule_state_renewal(clp);
> +		return 0;
> +	}
> +
> +	now = jiffies;
> +	status = nfs4_proc_get_lease_time(clp, &fsinfo);

nfs4_proc_get_lease_time() is defined under a CONFIG_NFS_V4_1 block, so
this still won't compile. As far as I can tell, there isn't anything
v4.1 specific to nfs4_proc_get_lease_time() and the corresponding xdr
code so it's probably safe to move all this out too.

Anna

> +	if (status == 0) {
> +		nfs4_set_lease_period(clp, fsinfo.lease_time * HZ,
> now);
> +		nfs4_schedule_state_renewal(clp);
> +	}
> +
> +	return status;
> +}
> +
>  int nfs4_init_clientid(struct nfs_client *clp, const struct cred
> *cred)
>  {
>  	struct nfs4_setclientid_res clid = {
> @@ -286,27 +307,6 @@ static int nfs4_begin_drain_session(struct
> nfs_client *clp)
>  
>  #if defined(CONFIG_NFS_V4_1)
>  
> -static int nfs4_setup_state_renewal(struct nfs_client *clp)
> -{
> -	int status;
> -	struct nfs_fsinfo fsinfo;
> -	unsigned long now;
> -
> -	if (!test_bit(NFS_CS_CHECK_LEASE_TIME, &clp->cl_res_state)) {
> -		nfs4_schedule_state_renewal(clp);
> -		return 0;
> -	}
> -
> -	now = jiffies;
> -	status = nfs4_proc_get_lease_time(clp, &fsinfo);
> -	if (status == 0) {
> -		nfs4_set_lease_period(clp, fsinfo.lease_time * HZ,
> now);
> -		nfs4_schedule_state_renewal(clp);
> -	}
> -
> -	return status;
> -}
> -
>  static void nfs41_finish_session_reset(struct nfs_client *clp)
>  {
>  	clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);

  reply	other threads:[~2019-06-28 18:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 12:36 [PATCH 0/4 RESEND] nfs4.0: Refetch lease_time after clientID reset Donald Buczek
2019-06-28 12:36 ` [PATCH 1/4 RESEND] nfs: Fix copy-and-paste error in debug message Donald Buczek
2019-06-28 12:36 ` [PATCH 2/4 RESEND] nfs4: Rename nfs41_setup_state_renewal Donald Buczek
2019-06-28 12:36 ` [PATCH 3/4 RESEND] nfs4: Move nfs4_setup_state_renewal Donald Buczek
2019-06-28 18:29   ` Schumaker, Anna [this message]
2019-06-28 19:48     ` Donald Buczek
2019-07-01 10:21   ` kbuild test robot
2019-06-28 12:36 ` [PATCH 4/4 RESEND] nfs4.0: Refetch lease_time after clientid update Donald Buczek

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=4a732990d3f2797591fb79ef0b04983a17a16c6e.camel@netapp.com \
    --to=anna.schumaker@netapp.com \
    --cc=buczek@molgen.mpg.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /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).