Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp508167imn; Wed, 27 Jul 2022 12:08:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7eu31GSJRflSakyQhIK2vn/23SiOSGnoWnwLTCTptqy+UqtNq0uzpuMiXeM5GcSEJcwj8 X-Received: by 2002:a63:521a:0:b0:41a:57d6:2fdb with SMTP id g26-20020a63521a000000b0041a57d62fdbmr20141874pgb.146.1658948900599; Wed, 27 Jul 2022 12:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948900; cv=none; d=google.com; s=arc-20160816; b=mcaMdVatdyEVTCgq6uHmrLeGtDYaQ1pHvhxpx+Wau6EqPCiddkYbUStY9wmLOmt66S 1yNM4yPyWRDY47s/6An9+8xGKUbMrZhf5K61/PDveFvgSXvGBYrfA+areyRuShCSn3Zg 6Dwmun15eNIJ3l9w3WlDWZ8FLG6nptW74Wqu3epH2uI8h5nDQ6wHfq5tgsxahwEL4vrX DvwegICBmNdbn7kC+vXV8Uv/5HbzoQ4e5ahUZ6r89evvqUQBOkNXZEjKVAm/K+V306kv ZrM105MEex2g3fTUBMSeuF/UK8Wn5cGM+TiQ/RHl75mu+C3uoxc7PlDvUZp82+g/EzAL GhIg== 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=t2GJ8ecLyACkm3yGCU+tyKXPq7W7Z5lEfo3m0Wp3r00=; b=hEnSN1D1isPPhOuR+ypi3uWa4WdlWq0bJuK/9JQaizGQrqrxOI6DNIBfrzbGW6n9qI Qs/ASVrWfE0+RLOhITfoydGpNo7qc/jMBFpt3MwZh/b/UoJX6FEh4AWQ4dit1dPVaL6b mtDumxByEsKg63nEc6PGID6uT+7tDgzM2rVJ1iCSX3Mo9bFeLUdqUeXnnGaMd2rvyLSZ uPh70lZ3S7G2bCCqjUQGzDsuBAEmGAuOc7B6MBBcSrb2HBCR6lSL93uU9cdBKcrtbhWx MWFDDd8bRSIDYhmSVrriXksoCq5SqK1GVLAZDMOv0Neg/9M+WzU65S839QdzjpKD2vIh k6+Q== 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 x124-20020a633182000000b0041aee1c45f6si10777732pgx.504.2022.07.27.12.08.00; Wed, 27 Jul 2022 12:08:20 -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 S234629AbiG0THd (ORCPT + 99 others); Wed, 27 Jul 2022 15:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234589AbiG0THK (ORCPT ); Wed, 27 Jul 2022 15:07:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A827458B55 for ; Wed, 27 Jul 2022 11:40:19 -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 8B493B821E5 for ; Wed, 27 Jul 2022 18:40:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29C52C433C1 for ; Wed, 27 Jul 2022 18:40:17 +0000 (UTC) Subject: [PATCH v2 03/13] NFSD: Shrink size of struct nfsd4_copy_notify From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Wed, 27 Jul 2022 14:40:16 -0400 Message-ID: <165894721620.11193.18315530218658312788.stgit@manet.1015granger.net> In-Reply-To: <165894669884.11193.6386905165076468843.stgit@manet.1015granger.net> References: <165894669884.11193.6386905165076468843.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 struct nfsd4_copy_notify is part of struct nfsd4_op, which resides in an 8-element array. sizeof(struct nfsd4_op): Before: /* size: 2208, cachelines: 35, members: 5 */ After: /* size: 1696, cachelines: 27, members: 5 */ Signed-off-by: Chuck Lever --- fs/nfsd/nfs4proc.c | 4 ++-- fs/nfsd/nfs4xdr.c | 12 ++++++++++-- fs/nfsd/xdr4.h | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 4a09cb473378..dca4c6b8f74c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1953,9 +1953,9 @@ nfsd4_copy_notify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, /* For now, only return one server address in cpn_src, the * address used by the client to connect to this server. */ - cn->cpn_src.nl4_type = NL4_NETADDR; + cn->cpn_src->nl4_type = NL4_NETADDR; status = nfsd4_set_netaddr((struct sockaddr *)&rqstp->rq_daddr, - &cn->cpn_src.u.nl4_addr); + &cn->cpn_src->u.nl4_addr); WARN_ON_ONCE(status); if (status) { nfs4_put_cpntf_state(nn, cps); diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 9b8091c177bc..06a9d7632552 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1952,10 +1952,17 @@ nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp, { __be32 status; + cn->cpn_src = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_src)); + if (cn->cpn_src == NULL) + return nfserr_jukebox; + cn->cpn_dst = svcxdr_tmpalloc(argp, sizeof(*cn->cpn_dst)); + if (cn->cpn_dst == NULL) + return nfserr_jukebox; + status = nfsd4_decode_stateid4(argp, &cn->cpn_src_stateid); if (status) return status; - return nfsd4_decode_nl4_server(argp, &cn->cpn_dst); + return nfsd4_decode_nl4_server(argp, cn->cpn_dst); } static __be32 @@ -4898,7 +4905,8 @@ nfsd4_encode_copy_notify(struct nfsd4_compoundres *resp, __be32 nfserr, *p++ = cpu_to_be32(1); - return nfsd42_encode_nl4_server(resp, &cn->cpn_src); + nfserr = nfsd42_encode_nl4_server(resp, cn->cpn_src); + return nfserr; } static __be32 diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 6e6a89008ce1..f253fc3f4708 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -595,13 +595,13 @@ struct nfsd4_offload_status { struct nfsd4_copy_notify { /* request */ stateid_t cpn_src_stateid; - struct nl4_server cpn_dst; + struct nl4_server *cpn_dst; /* response */ stateid_t cpn_cnr_stateid; u64 cpn_sec; u32 cpn_nsec; - struct nl4_server cpn_src; + struct nl4_server *cpn_src; }; struct nfsd4_op {