All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nfsd: make "gc" parameter a bool
@ 2022-10-26  8:15 Jeff Layton
  2022-10-26  8:15 ` [PATCH 2/2] nfsd: rework refcounting in filecache Jeff Layton
  2022-10-26 13:15 ` [PATCH 1/2] nfsd: make "gc" parameter a bool Chuck Lever III
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Layton @ 2022-10-26  8:15 UTC (permalink / raw)
  To: chuck.lever; +Cc: neilb, linux-nfs

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-27 10:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 1/2] nfsd: make "gc" parameter a bool Chuck Lever III

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.