Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1180572rwb; Thu, 6 Oct 2022 09:24:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZMjpBa7W9ilMcg95qu+zwUkL8af8+CSAnteUYqVvVBDpfN8VI+2+aMZbXznwBU36y1zlE X-Received: by 2002:a17:902:e5cb:b0:17f:8cb6:7d5e with SMTP id u11-20020a170902e5cb00b0017f8cb67d5emr305803plf.116.1665073476595; Thu, 06 Oct 2022 09:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665073476; cv=none; d=google.com; s=arc-20160816; b=aSatbEp3VVQtSFMroTwyGPaUw0p71z/qbPFyScsWTBjtm5Wklc7UexQI2Rf0t7pdYk ucvE9zFyHuNXuyJxQf9F3dAXcuH6WJNV9o7h8xlOV9iRlSlbEVKreJHNDavxLRdagX/T 9vaai5Et50OfKQYhCJaMvNg7Ev1h/IgYJxawSkxLDwQ9T1DOd82qRk3xKNE19xST1o7B BbS2+tPzjdS4Axb+ytQUSMrnUSAv/mM95ApB5Ch9t1DrULUspqBCu+AibWTrdRpWP1JY RJzC+pclfngv6FJ17q5WIwfQkXEdukcqGx6Zf5IPQPYhJcTmzIzKSRtGvrovgrPopxWJ 64Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=xTX+SVTBlCj1mokGlZu4vRNYG+kLaCTu1gK0fCNqkDo=; b=vmzrnkXwgCXPSBwRekWqHAv9XKMzpLxvcxDh2Ujrlwm9cdO9t/lM/FZiZlc6R1Z6n5 80kcDxF69xycmO1tRLqBRHKCCNaGcfL6f/jIzxN+M1IbEjgw2hnul+NP0yfus+tJZ7po 7/lSo34dEzvtAZ+j37dXafOqYe8NU5GKh+VD4bAuYX6R3HgopmPiy4x25LN1Koy8Dbe7 kzl+TRa9qMo+pta4N1j9hnfMSfa7hHz3M56B5eeTzZv1gX+Hm1Esgete18KSYvZg/QH0 9gZxQT1h8KPQXZwUFCRQrB7/uFZ2ryUFSxS+TuXpXYoteDigtX5GgwA2oHxPS5/ge11B BqKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a056a00134d00b0052b75c32fd2si20009185pfu.48.2022.10.06.09.24.23; Thu, 06 Oct 2022 09:24:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230202AbiJFQUt (ORCPT + 99 others); Thu, 6 Oct 2022 12:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbiJFQUs (ORCPT ); Thu, 6 Oct 2022 12:20:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28396A4B81 for ; Thu, 6 Oct 2022 09:20:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ED2BBB820DD for ; Thu, 6 Oct 2022 16:20:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DB26C433D6 for ; Thu, 6 Oct 2022 16:20:43 +0000 (UTC) Subject: [PATCH v2 6/9] NFSD: Use const pointers as parameters to fh_ helpers. From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Thu, 06 Oct 2022 12:20:42 -0400 Message-ID: <166507324261.1802.17831329580956246961.stgit@manet.1015granger.net> In-Reply-To: <166507275951.1802.13184584115155050247.stgit@manet.1015granger.net> References: <166507275951.1802.13184584115155050247.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Enable callers to use const pointers where they are able to. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever --- 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;