Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6478759rwi; Tue, 18 Oct 2022 13:00:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ReY/6G/l/gjeiWjI0WN/qdSqUt5xmbboQqOll+zxxiOIOQ7NdZ0sgTAvjmlGno6yut2eM X-Received: by 2002:a05:6402:448c:b0:457:52eb:b57e with SMTP id er12-20020a056402448c00b0045752ebb57emr4245026edb.178.1666123249407; Tue, 18 Oct 2022 13:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666123249; cv=none; d=google.com; s=arc-20160816; b=h9qN+mTvcNg/b7kda+0vZq2ZwL7S+DQnAIDdww2nqbAu134WW9YDWlzWuVjwV42iC/ 7fDGpBqnEmpCWOuaNXWt+lXFiAKqr0fP/YU27xIK78UIQLa4CiAi3tJDLo6bMV8/KAm6 jDQTbglm7QppxCs5SF7dnQV/xJYW7O2azXzrPetaKRz58wsx6KKlnCKKnXAX5QFzFqvk iPDnXjze1b6HvN13q26YBkatEdzDjTDN7Z6xkrSIjgz+kzkk54VSR38+6uqXoIB05ytY tl1jg4gijEqdm7/cfBdzPuD5Kmngzdo1AMwSop+w3Ir6SRTCr4XsDt/AJallG+2VXkPQ OrzQ== 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=CC1Yh29Lklx2iHcYmxLjSZzwyhiHcAWyDgrh9Gdj8K0=; b=ACieLyMA9lCu5pmTffndNJvhrC6gsuWpWJ0Qn/rLb6+3hOy9Glw3yc8hes9k+Kukvo ITmWZ/7B5UjMJjUTjNtZTbIxYl4BHoEuuFuYoI7JpZqUrPFZx/8RMUTeumdufr0wjNGf I1U6YTPmBbIc9lbOSPzXSitaJrWxdc3CvDFlRc95eWOwJkPm0jSLiHQVXOl/x08jDjXR M6mfnfoudXdubGQWPc9Z1W/qXWxeAAy05vAYF7ZUOIMy/jXWvGtYrIg8F7JLRvEnQdHj TiVokuS7j7iTfdcz3QJSusfhkrMGUUg5vhKKFef+WVU0WN0a1VN9a1ZETbSmNcfWsisE R4DA== 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 b25-20020aa7dc19000000b0045ccd2c9944si10405621edu.233.2022.10.18.13.00.22; Tue, 18 Oct 2022 13:00:49 -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 S229892AbiJRT6x (ORCPT + 99 others); Tue, 18 Oct 2022 15:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbiJRT6t (ORCPT ); Tue, 18 Oct 2022 15:58:49 -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 7C0E09AC29 for ; Tue, 18 Oct 2022 12:58:48 -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 EDBB5B82106 for ; Tue, 18 Oct 2022 19:58:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81616C4314C; Tue, 18 Oct 2022 19:58:45 +0000 (UTC) Subject: [PATCH v4 4/7] NFSD: Use const pointers as parameters to fh_ helpers From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: neilb@suse.de Date: Tue, 18 Oct 2022 15:58:44 -0400 Message-ID: <166612312451.1291.10615396222464284428.stgit@manet.1015granger.net> In-Reply-To: <166612295223.1291.11761205673682408148.stgit@manet.1015granger.net> References: <166612295223.1291.11761205673682408148.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 Tested-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;