All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Neil Brown <neilb@suse.de>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] nfsd: make "gc" parameter a bool
Date: Wed, 26 Oct 2022 13:15:23 +0000	[thread overview]
Message-ID: <EFC738D6-8728-4DAF-839A-3D4565B7BC7F@oracle.com> (raw)
In-Reply-To: <20221026081539.219755-1-jlayton@kernel.org>



> On Oct 26, 2022, at 4:15 AM, Jeff Layton <jlayton@kernel.org> wrote:
> 
> This gets compared to the result of test_bit which may or may not always
> exactly match what the bitfield holds. Bitfields in C can be unintuitive
> to deal with. Make it a bool instead. This doesn't change the size of
> the struct anyway.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

I've already done this in my tree, thought it was in the repo already!
Thanks for the nudge.


> ---
> fs/nfsd/filecache.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index 106e99b24b6f..918d67cec1ad 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -63,7 +63,7 @@ struct nfsd_file_lookup_key {
> 	struct net			*net;
> 	const struct cred		*cred;
> 	unsigned char			need;
> -	unsigned char			gc:1;
> +	bool				gc;
> 	enum nfsd_file_lookup_type	type;
> };
> 
> @@ -1034,7 +1034,7 @@ nfsd_file_is_cached(struct inode *inode)
> static __be32
> nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
> 		     unsigned int may_flags, struct nfsd_file **pnf,
> -		     bool open, int want_gc)
> +		     bool open, bool want_gc)
> {
> 	struct nfsd_file_lookup_key key = {
> 		.type	= NFSD_FILE_KEY_FULL,
> @@ -1161,7 +1161,7 @@ __be32
> nfsd_file_acquire_gc(struct svc_rqst *rqstp, struct svc_fh *fhp,
> 		     unsigned int may_flags, struct nfsd_file **pnf)
> {
> -	return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, true, 1);
> +	return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, true, true);
> }
> 
> /**
> @@ -1182,7 +1182,7 @@ __be32
> nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
> 		  unsigned int may_flags, struct nfsd_file **pnf)
> {
> -	return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, true, 0);
> +	return nfsd_file_do_acquire(rqstp, fhp, may_flags, pnf, true, false);
> }
> 
> /**
> -- 
> 2.37.3
> 

--
Chuck Lever




      parent reply	other threads:[~2022-10-26 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  8:15 [PATCH 1/2] nfsd: make "gc" parameter a bool Jeff Layton
2022-10-26  8:15 ` [PATCH 2/2] nfsd: rework refcounting in filecache Jeff Layton
2022-10-26 11:17   ` Jeff Layton
2022-10-26 13:22   ` Chuck Lever III
2022-10-26 22:32   ` NeilBrown
2022-10-27 10:04     ` Jeff Layton
2022-10-26 13:15 ` Chuck Lever III [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=EFC738D6-8728-4DAF-839A-3D4565B7BC7F@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.