Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp943555imi; Fri, 22 Jul 2022 13:10:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sBW7alSP0VEw9ZmwgOEF08YmDhs7oAi/VY9AL3bAyrURDpnokLw7PgjCs9UCBbj8LTRfFS X-Received: by 2002:a05:6402:350c:b0:43a:e25f:d73 with SMTP id b12-20020a056402350c00b0043ae25f0d73mr1519871edd.66.1658520650577; Fri, 22 Jul 2022 13:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658520650; cv=none; d=google.com; s=arc-20160816; b=ueHTxAMMNR2TLeSygykpM2y4rVqK+hOUPyJLeDo5hQCYibgc2Zuyzhfk8McRwGJzgo G9ylCwzbe5fNmd5AYHUpuf2Br+lNcJGa59rD4gNAbre3YW7uc5K/l3a9Yfp+5agnDC/5 Xr3WAZ07ht4wVIeseDXtQY8o4TIT5x7U6BCHWvsuJzRiQLl/raEFw1rjlD0iqcLHlUo+ ICWJtLQuveLeN6lIrS7Affn3Jqv5q4kb5xcE/8nUi4N8uCjBA5Wr0puksbmNO/3m0a86 ygpArq4embniFifT9xSrWDjY0IIUS5f5uwoXq5ENmqqgONc2PIDYOHrS/D9CVRsbdsh5 lq+w== 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:message-id:date:to:from:subject; bh=IL0aPkBrKO5OsipnIIR0ws/WkulnX6DIxZNXeGwJsZg=; b=rv2LFZmiYnglotRH5/KlK0b/Mk6hREob7t83aA3muWORw9IOjiiHDOZuho3IQS4qcd 1vIOZQW7QN9JBdIVhxOOrOx0QM8VjM5DOA5lbwekMy1pg+jbXootx6ApQQF2kCti7EIu xptFhcaTqAo25pzmjAQPzVarv6MyIjFzH9vmrZgkgFNd3Xxx6k3DmIe1cRh1kCNacY5B Qw45Ga8ficBQuSvzrEy1B28TpKTqS/j0X9bc4BDBVCcVtuWRtL1JDCglobc78TYc/8IV VB5872QZmA3XdHg7ECzpyoDdoHz0Sl0VORPi6nNTJyl1VmhEtJFJ91Z+PzTvNCPid0Kh E7uQ== 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 va1-20020a17090711c100b00726a74341e7si6035525ejb.823.2022.07.22.13.10.18; Fri, 22 Jul 2022 13:10:50 -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 S236672AbiGVUJJ (ORCPT + 99 others); Fri, 22 Jul 2022 16:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236815AbiGVUIw (ORCPT ); Fri, 22 Jul 2022 16:08:52 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88950B505A for ; Fri, 22 Jul 2022 13:08:43 -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 sin.source.kernel.org (Postfix) with ESMTPS id E86ECCE2B0A for ; Fri, 22 Jul 2022 20:08:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BD95C341C6 for ; Fri, 22 Jul 2022 20:08:40 +0000 (UTC) Subject: [PATCH v1 1/8] NFSD: Optimize nfsd4_encode_operation() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 22 Jul 2022 16:08:38 -0400 Message-ID: <165852051841.11198.2929614302983292322.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 write_bytes_to_xdr_buf() is a generic way to place a variable-length data item in an already-reserved spot in the encoding buffer. However, it is costly, and here, it is unnecessary because the data item is fixed in size, the buffer destination address is always word-aligned, and the destination location is already in @p. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 2acea7792bb2..b52ea7d8313a 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5373,8 +5373,7 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) so->so_replay.rp_buf, len); } status: - /* Note that op->status is already in network byte order: */ - write_bytes_to_xdr_buf(xdr->buf, post_err_offset - 4, &op->status, 4); + *p = op->status; } /*