Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1271151rwb; Tue, 27 Sep 2022 10:34:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yVIg2ucuueq3xVeufXsvkPZ8K11yRTLsHsLGPcOX4lxm/Q9taterYXO2lZO18J3W88KS7 X-Received: by 2002:a17:907:7e83:b0:782:7c78:3828 with SMTP id qb3-20020a1709077e8300b007827c783828mr21346313ejc.7.1664300077549; Tue, 27 Sep 2022 10:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664300077; cv=none; d=google.com; s=arc-20160816; b=JrbBhkoXaiUhWi55wZUbPlG+L0xgvgYhIf26RWV/3a8XHEmAlyl0spIO5F9jmE0mTQ Md2/HcgpZMdxXANbw5oumtOvib8BKJRVDm2gS9xoXxJS72S6ePRipT2vUL9h6VH1ygVS WXrTbcNRH5lmVP98gu1MOiIA/JfrgDPQ+cjbfLup0QH3mwsIogBA7BIPVb4lA3HoJuK2 kYWoa+CJtH+F2Ipc+mlsBoOQLfhjxANCppiQDpHGIXHxKMsEI2KyHV6Hh/F882nknvth rAPNuEpFLyICXEMcoEH+uyIpFONYkkcyO3yP/U+sZQEU7x1MCAFQjNkFbpXRkDvuIY9m BRew== 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:cc:to:from :subject; bh=al8QUecJ0UkTfw5MU1y0G1NuSZblKVbCHDi6KPi3jIk=; b=VAMd3GiRawPBbJ39eOFwIbkT0o2buAkWC32wQUxI1pftZUKZnPanXkf8JOg2nKcdGX CEId5+pb9ObFecluODnNKGaAyh9Wraa4nV3wm9DAp0pD8brI40mpzCZxPvmDMMS6LDBR pfPbx4AuUY9Nz7r1UokJDqSWP35d9ytbJzemx3jc3IiBaZFBDyNsvGcSLFW1tgMlAp6P PNrO/QeDNlD/0YjOiCWAeOvmxZVGhZed0Al2JvzwRcn95t0Dbs5ACryICnW7jMA+LWQ/ gBe1M4+O2YsqH/8Ic9kD+9X6VY8COwoVfEaV3KLNep4NXRormis7kO0OvVGnRiB0xkzd jfjA== 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 ne7-20020a1709077b8700b0077fb99b8cfcsi1993677ejc.301.2022.09.27.10.33.49; Tue, 27 Sep 2022 10:34:37 -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 S230214AbiI0RWb (ORCPT + 99 others); Tue, 27 Sep 2022 13:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbiI0RWa (ORCPT ); Tue, 27 Sep 2022 13:22:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E999D1C6A53 for ; Tue, 27 Sep 2022 10:22:29 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8530C619A5 for ; Tue, 27 Sep 2022 17:22:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4BCAC433C1; Tue, 27 Sep 2022 17:22:28 +0000 (UTC) Subject: [PATCH RFC 1/2] NFSD: Use const pointers as parameters to fh_ helpers. From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: jlayton@redhat.com, bfields@fieldses.org Date: Tue, 27 Sep 2022 13:22:27 -0400 Message-ID: <166429934767.4564.15158940045518480210.stgit@manet.1015granger.net> In-Reply-To: <166429914973.4564.115423416224540586.stgit@manet.1015granger.net> References: <166429914973.4564.115423416224540586.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. 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;