linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruce Fields <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfsd: helper for laundromat expiry calculations
Date: Wed, 3 Mar 2021 17:01:15 -0500	[thread overview]
Message-ID: <20210303220115.GG3949@fieldses.org> (raw)
In-Reply-To: <63E16B3E-2524-4257-BB70-F685330554F3@oracle.com>

On Wed, Mar 03, 2021 at 09:59:48PM +0000, Chuck Lever wrote:
> 
> 
> > On Mar 3, 2021, at 4:55 PM, Bruce Fields <bfields@fieldses.org> wrote:
> > 
> > On Wed, Mar 03, 2021 at 09:35:18PM +0000, Chuck Lever wrote:
> >> 
> >> 
> >>> On Mar 2, 2021, at 10:46 AM, Bruce Fields <bfields@fieldses.org> wrote:
> >>> 
> >>> From: "J. Bruce Fields" <bfields@redhat.com>
> >>> 
> >>> We do this same logic repeatedly, and it's easy to get the sense of the
> >>> comparison wrong.
> >>> 
> >>> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> >>> ---
> >>> fs/nfsd/nfs4state.c | 49 +++++++++++++++++++++++++--------------------
> >>> 1 file changed, 27 insertions(+), 22 deletions(-)
> >>> 
> >>> My original version of this patch... actually got the sense of the
> >>> comparison wrong!
> >>> 
> >>> Now actually tested.
> >>> 
> >>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> >>> index 61552e89bd89..8e6938902b49 100644
> >>> --- a/fs/nfsd/nfs4state.c
> >>> +++ b/fs/nfsd/nfs4state.c
> >>> @@ -5363,6 +5363,22 @@ static bool clients_still_reclaiming(struct nfsd_net *nn)
> >>> 	return true;
> >>> }
> >>> 
> >>> +struct laundry_time {
> >>> +	time64_t cutoff;
> >>> +	time64_t new_timeo;
> >>> +};
> >>> +
> >>> +bool state_expired(struct laundry_time *lt, time64_t last_refresh)
> >>> +{
> >>> +	time64_t time_remaining;
> >>> +
> >>> +	if (last_refresh < lt->cutoff)
> >>> +		return true;
> >>> +	time_remaining = last_refresh - lt->cutoff;
> >>> +	lt->new_timeo = min(lt->new_timeo, time_remaining);
> >>> +	return false;
> >>> +}
> >>> +
> >> 
> >> /home/cel/src/linux/linux/fs/nfsd/nfs4state.c:5371:6: warning: no previous prototype for ‘state_expired’ [-Wmissing-prototypes]
> >> 5371 | bool state_expired(struct laundry_time *lt, time64_t last_refresh)
> >>      |      ^~~~~~~~~~~~~
> >> 
> >> Should this new helper be static, or instead perhaps these items
> >> should be defined in a header file.
> > 
> > Whoops, should have been static, yes, do you want to fix it up or should
> > I resend?
> 
> I've corrected it in the for-next topic branch in
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git

Thank you!

--b.

      reply	other threads:[~2021-03-04  0:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 15:46 [PATCH] nfsd: helper for laundromat expiry calculations Bruce Fields
2021-03-03 15:37 ` Chuck Lever
2021-03-03 21:35 ` Chuck Lever
2021-03-03 21:55   ` Bruce Fields
2021-03-03 21:59     ` Chuck Lever
2021-03-03 22:01       ` Bruce Fields [this message]

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=20210303220115.GG3949@fieldses.org \
    --to=bfields@fieldses.org \
    --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).