Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1211302rdh; Mon, 25 Sep 2023 06:31:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5FjNI+0pToEliwafJSfUi5HYbBSljYf6wp9mNsrR+jy25WihnPxKPVRCOX9Pupw6RfHPy X-Received: by 2002:a05:6a20:1614:b0:15a:3eaa:b7f8 with SMTP id l20-20020a056a20161400b0015a3eaab7f8mr8350586pzj.50.1695648667325; Mon, 25 Sep 2023 06:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695648667; cv=none; d=google.com; s=arc-20160816; b=VU54G2SQsR/JHSGniqWL9tXr6Wgm0BzOpPFgM7UC1+wZh3r0lqQZp04M9/ZSviofZF JvL1VDxcwuHzL3uEIJ1B303KL0fCrDjHim2kVyMouk4OS7xGu7X3cOqW7zqLhgK36T4h EbokW7I1mN0PqIjQjOcXHz3Kj6Q4s4HgnsRh76q6BuFee9+InRnahgMhAmcvZRdh9aLi cqMahUc0XMkAgIMjF4YG1rW66vvJBe5fVI8jVvaKlzRIk+8lFMHalRE3XOO8h8mzNrnd aNg0AWXbwPmgJMLzgYrvS2kYi74ZokEcPiWiO7o0ioSuzyPjF2XMyLRwaeLIpgTslR5Y SGjA== 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:dkim-signature; bh=b/fgtnvTbf5P1+9PccQvsRCA1FMIAIrzLMvJgrNjQ+o=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=sIv1jtZnqAqgY2J7spH6SWKZHPuevTvw2mR5gGl1dYzZqdBL5LoarKopElAwU8oi7w GnL5iQullW8j2d85kw6W/qvGdh5nuvTM35KkcWlVKNKQSNusXE7LOaAV632NgSDver0U tiORekKQcRD//595xU4ds26H+bV7IdBtp4DbogyqvDAs7BStQPw2g8IbqGE1O/SFaDdT Ft0LnCx2LwTTYlzuE0xx/W1bCKJECF+C/Tumv8ll7Lc/n/ny8EJk5HjB0dcURHZKmh5A dlhxTPIOiZyIq9fxNSRVdspvdaTTH994PfA3eyFooVPZDjfsk+CPNYivmJ4FDi8ZemOJ T24Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kVXlJLQv; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h6-20020a170902680600b001c434927d8dsi10179217plk.131.2023.09.25.06.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 06:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kVXlJLQv; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8E54E80758E8; Mon, 25 Sep 2023 06:28:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbjIYN2E (ORCPT + 99 others); Mon, 25 Sep 2023 09:28:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbjIYN17 (ORCPT ); Mon, 25 Sep 2023 09:27:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5328410C for ; Mon, 25 Sep 2023 06:27:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB691C433C7; Mon, 25 Sep 2023 13:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695648472; bh=1k80C0uIrVKZKcMe5vFSypyJGsRR0SMMKu9LX5+FOXg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=kVXlJLQvX4Wd1sojMDnEPVrjeXGtWO+u28udnVuB3pA0ktTLoGTk/dskq9wZapC64 GERKlPeo958Axcu9OaScDkKK1fesIwG8GgFnukeQt5wITmFo2OhvnAwdSd5QLfQkbM jb4sxbOQdnjP/ANrU1slhTDn0aW2FfSwyOHI94VRs0JLbJerAj+HrFm4o2BFoXWDnf vah1azc/MQr86fkPy18zeEY+EC/HvkHgQGHLcgc123ZXfqyEP3ddT5+v3UCKGenyoR jaGE9hFoC0mOWcT5Zub3Agmykfha8bqbHqXfgXfBlh8ReWwtC/uo1ibc1W3GJY7Tzz c9A9xlKBFlbJw== Subject: [PATCH v1 3/8] NFSD: Make @lgp parameter of ->encode_layoutget a const pointer From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 25 Sep 2023 09:27:51 -0400 Message-ID: <169564847171.6013.1770752570260963034.stgit@klimt.1015granger.net> In-Reply-To: <169564827064.6013.5014460767978657478.stgit@klimt.1015granger.net> References: <169564827064.6013.5014460767978657478.stgit@klimt.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:28:00 -0700 (PDT) From: Chuck Lever This enables callers to be passed const pointer parameters. Signed-off-by: Chuck Lever --- fs/nfsd/blocklayoutxdr.c | 4 ++-- fs/nfsd/blocklayoutxdr.h | 2 +- fs/nfsd/flexfilelayoutxdr.c | 4 ++-- fs/nfsd/flexfilelayoutxdr.h | 2 +- fs/nfsd/pnfs.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/blocklayoutxdr.c b/fs/nfsd/blocklayoutxdr.c index 1ed2f691ebb9..f8469348e06e 100644 --- a/fs/nfsd/blocklayoutxdr.c +++ b/fs/nfsd/blocklayoutxdr.c @@ -16,9 +16,9 @@ __be32 nfsd4_block_encode_layoutget(struct xdr_stream *xdr, - struct nfsd4_layoutget *lgp) + const struct nfsd4_layoutget *lgp) { - struct pnfs_block_extent *b = lgp->lg_content; + const struct pnfs_block_extent *b = lgp->lg_content; int len = sizeof(__be32) + 5 * sizeof(__be64) + sizeof(__be32); __be32 *p; diff --git a/fs/nfsd/blocklayoutxdr.h b/fs/nfsd/blocklayoutxdr.h index bc5166bfe46b..5f88539e81a1 100644 --- a/fs/nfsd/blocklayoutxdr.h +++ b/fs/nfsd/blocklayoutxdr.h @@ -53,7 +53,7 @@ struct pnfs_block_deviceaddr { __be32 nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr, struct nfsd4_getdeviceinfo *gdp); __be32 nfsd4_block_encode_layoutget(struct xdr_stream *xdr, - struct nfsd4_layoutget *lgp); + const struct nfsd4_layoutget *lgp); int nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp, u32 block_size); int nfsd4_scsi_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp, diff --git a/fs/nfsd/flexfilelayoutxdr.c b/fs/nfsd/flexfilelayoutxdr.c index bb205328e043..5319cb97d8a7 100644 --- a/fs/nfsd/flexfilelayoutxdr.c +++ b/fs/nfsd/flexfilelayoutxdr.c @@ -17,9 +17,9 @@ struct ff_idmap { __be32 nfsd4_ff_encode_layoutget(struct xdr_stream *xdr, - struct nfsd4_layoutget *lgp) + const struct nfsd4_layoutget *lgp) { - struct pnfs_ff_layout *fl = lgp->lg_content; + const struct pnfs_ff_layout *fl = lgp->lg_content; int len, mirror_len, ds_len, fh_len; __be32 *p; diff --git a/fs/nfsd/flexfilelayoutxdr.h b/fs/nfsd/flexfilelayoutxdr.h index 8e195aeca023..a447efb7759b 100644 --- a/fs/nfsd/flexfilelayoutxdr.h +++ b/fs/nfsd/flexfilelayoutxdr.h @@ -45,6 +45,6 @@ struct pnfs_ff_layout { __be32 nfsd4_ff_encode_getdeviceinfo(struct xdr_stream *xdr, struct nfsd4_getdeviceinfo *gdp); __be32 nfsd4_ff_encode_layoutget(struct xdr_stream *xdr, - struct nfsd4_layoutget *lgp); + const struct nfsd4_layoutget *lgp); #endif /* _NFSD_FLEXFILELAYOUTXDR_H */ diff --git a/fs/nfsd/pnfs.h b/fs/nfsd/pnfs.h index 4f4282d4eeca..d8e1a333fa0a 100644 --- a/fs/nfsd/pnfs.h +++ b/fs/nfsd/pnfs.h @@ -31,8 +31,8 @@ struct nfsd4_layout_ops { __be32 (*proc_layoutget)(struct inode *, const struct svc_fh *fhp, struct nfsd4_layoutget *lgp); - __be32 (*encode_layoutget)(struct xdr_stream *, - struct nfsd4_layoutget *lgp); + __be32 (*encode_layoutget)(struct xdr_stream *xdr, + const struct nfsd4_layoutget *lgp); __be32 (*proc_layoutcommit)(struct inode *inode, struct nfsd4_layoutcommit *lcp);