linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH RFC 6/9] NFSD: Use const pointers as parameters to fh_ helpers.
Date: Thu, 06 Oct 2022 11:59:56 -0400	[thread overview]
Message-ID: <abe560c81f40939a0a1ee374d6ac6d60d4a85aaa.camel@kernel.org> (raw)
In-Reply-To: <166498177448.1527.15278030072978201509.stgit@manet.1015granger.net>

On Wed, 2022-10-05 at 10:56 -0400, Chuck Lever wrote:
> Enable callers to use const pointers where they are able to.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> Reviewed-by: Jeff Layton <jlayton@kernel.org>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>  fs/nfsd/nfsfh.h |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h
> index c3ae6414fc5c..513e028b0bbe 100644
> --- a/fs/nfsd/nfsfh.h
> +++ b/fs/nfsd/nfsfh.h
> @@ -220,7 +220,7 @@ __be32	fh_update(struct svc_fh *);
>  void	fh_put(struct svc_fh *);
>  
>  static __inline__ struct svc_fh *
> -fh_copy(struct svc_fh *dst, struct svc_fh *src)
> +fh_copy(struct svc_fh *dst, const struct svc_fh *src)
>  {
>  	WARN_ON(src->fh_dentry);
>  
> @@ -229,7 +229,7 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src)
>  }
>  
>  static inline void
> -fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src)
> +fh_copy_shallow(struct knfsd_fh *dst, const struct knfsd_fh *src)
>  {
>  	dst->fh_size = src->fh_size;
>  	memcpy(&dst->fh_raw, &src->fh_raw, src->fh_size);
> @@ -243,7 +243,8 @@ fh_init(struct svc_fh *fhp, int maxsize)
>  	return fhp;
>  }
>  
> -static inline bool fh_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2)
> +static inline bool fh_match(const struct knfsd_fh *fh1,
> +			    const struct knfsd_fh *fh2)
>  {
>  	if (fh1->fh_size != fh2->fh_size)
>  		return false;
> @@ -252,7 +253,8 @@ static inline bool fh_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2)
>  	return true;
>  }
>  
> -static inline bool fh_fsid_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2)
> +static inline bool fh_fsid_match(const struct knfsd_fh *fh1,
> +				 const struct knfsd_fh *fh2)
>  {
>  	if (fh1->fh_fsid_type != fh2->fh_fsid_type)
>  		return false;
> 
> 

Always a good idea.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2022-10-06 16:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 14:55 [PATCH RFC 0/9] A course adjustment, maybe Chuck Lever
2022-10-05 14:55 ` [PATCH RFC 1/9] nfsd: fix nfsd_file_unhash_and_dispose Chuck Lever
2022-10-05 14:55 ` [PATCH RFC 2/9] nfsd: rework hashtable handling in nfsd_do_file_acquire Chuck Lever
2022-10-05 14:55 ` [PATCH RFC 3/9] NFSD: Pass the target nfsd_file to nfsd_commit() Chuck Lever
2022-10-05 14:56 ` [PATCH RFC 4/9] NFSD: Revert "NFSD: NFSv4 CLOSE should release an nfsd_file immediately" Chuck Lever
2022-10-05 14:56 ` [PATCH RFC 5/9] NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection Chuck Lever
2022-10-06 15:59   ` Jeff Layton
2022-10-06 16:06     ` Chuck Lever III
2022-10-05 14:56 ` [PATCH RFC 6/9] NFSD: Use const pointers as parameters to fh_ helpers Chuck Lever
2022-10-06 15:59   ` Jeff Layton [this message]
2022-10-05 14:56 ` [PATCH RFC 7/9] NFSD: Use rhashtable for managing nfs4_file objects Chuck Lever
2022-10-05 15:11   ` Chuck Lever III
2022-10-06 16:12     ` Jeff Layton
2022-10-06 16:15       ` Chuck Lever III
2022-10-05 14:56 ` [PATCH RFC 8/9] NFSD: Clean up nfs4_preprocess_stateid_op() call sites Chuck Lever
2022-10-06 16:05   ` Jeff Layton
2022-10-05 14:56 ` [PATCH RFC 9/9] NFSD: Trace delegation revocations Chuck Lever
2022-10-06 16:06   ` Jeff Layton

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=abe560c81f40939a0a1ee374d6ac6d60d4a85aaa.camel@kernel.org \
    --to=jlayton@kernel.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).