Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp70209rdb; Mon, 18 Sep 2023 08:29:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBmrOtxEkP0J/X521FY6GS0FW91tYEDA0dJusaWFx7yKeUdfnuBbnObcWAF/FyT/449iWc X-Received: by 2002:a17:903:41c4:b0:1bb:d280:5e0b with SMTP id u4-20020a17090341c400b001bbd2805e0bmr9381924ple.18.1695050951135; Mon, 18 Sep 2023 08:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695050951; cv=none; d=google.com; s=arc-20160816; b=kIUUG+MKBlszFdEd95g2O1r4If9MatkxotJ+w6jUHuW3A04KYUgY6yrbo9s9o3dMSW 6B00MccbNzhqb3PXlDbDcUOjHEWHzX0Kz0GJBN3Z4Cc9hgbXVFOJ320/PI7Xh3NZQzEF 7I6EEYMxNqeuuMo6EHZt+A4d8zFEb5HjNly98yr9TCN8P0e1oF9nvzc5WBjqPv2I6GAF l6FO8jS0aNrFKqRf2q/e55RaCQV7eLKMsujmcoxnjxT8ROuSUopo6yBHk72SNmWnH4oh PbnfslttuemaEVo9+VGUNq+5ERtyWKqmiE8ODYWdx1gY/+ANuXHw8NSZCl0jzz0oBLCC /kFw== 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=Rdn1HufJfILo7v3xFXCululvRMT6y1FFW66xaYXWfi4=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=fuac7Wxmw9rmzyx1ChytfeY5bD588FgnyjsGuBMOVCWVgD13kXG+rbxlUJwoRz6OL2 Pw05vPSRWwT1MS+iOMGwjJm3ZcgV06LUKN/iImarhKuGaWIwEJB54LW7zFc03Ujcxm1J YaMTQb71uoOVZbCkQmCQdNdxnvkkGhmCcNp8LGTufo/lCsSALt1RTRUIp60lu0XmlWy/ SSYjmZmz1AsPiNfZbew4jn6bdBVfIDZqWGGY7ggxYg3IeawFRD0S/u0WdbYzUZRqm9bI 2Ru43cIm3FX8mJsUWVmEYdFDnhDFZibtklF4IevhAGhj23rrytx+Zk+O24Xl7Y2SvBz1 CCeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BnyKX4ZJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z21-20020a631915000000b0055785a37147si7853281pgl.590.2023.09.18.08.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 08:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BnyKX4ZJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 41FB4821120D; Mon, 18 Sep 2023 08:24:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240762AbjIRPYS (ORCPT + 99 others); Mon, 18 Sep 2023 11:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241004AbjIRPYQ (ORCPT ); Mon, 18 Sep 2023 11:24:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36E78BA for ; Mon, 18 Sep 2023 08:22:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773A7C116D3; Mon, 18 Sep 2023 14:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695045676; bh=7T/ahaIQ40lO0iadikPZJwQTz6UCKqt6StYeT1YAY9c=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=BnyKX4ZJW2VfzBToga9cZ7p1Sz+8NcuVdMPhJzIo4bhIGw4Nq80UhbUq5F9Muq2Ol lEutkaxaFT3LKJTtb7wxF7nlCZ7MqmEVK5/r71/XsxjbbhKK8tnKz3zE5UOmdZdSKP YL7vNmAq6w6wvV36dD3HDpVKjTvfMAfB1OZgdXb8xebTa5qFrFfbulHIZRStlbgqlB RqkPf+lBFjRwLaJUoEjPVhEG5eRk6Uwqun/y7/eNghXMo5cuc+or9yq/kHZS6DHtvN kJnicJ0fMmTS+tTR91IQw4M7Fc6Opluj5fcv5k+niBgVA8jhKzA7vS0a//1L9E0rk6 lsjV0AIrlCalg== Subject: [PATCH v1 42/52] NFSD: Add nfsd4_encode_fattr4_time_modify() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 18 Sep 2023 10:01:15 -0400 Message-ID: <169504567550.133720.11907611503992862711.stgit@manet.1015granger.net> In-Reply-To: <169504501081.133720.4162400017732492854.stgit@manet.1015granger.net> References: <169504501081.133720.4162400017732492854.stgit@manet.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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:24:18 -0700 (PDT) From: Chuck Lever Refactor the encoder for FATTR4_TIME_MODIFY into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 75121b4a6020..730596c53258 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3268,6 +3268,12 @@ static __be32 nfsd4_encode_fattr4_time_metadata(struct xdr_stream *xdr, return nfsd4_encode_nfstime4(xdr, &args->stat.ctime); } +static __be32 nfsd4_encode_fattr4_time_modify(struct xdr_stream *xdr, + const struct nfsd4_fattr_args *args) +{ + return nfsd4_encode_nfstime4(xdr, &args->stat.mtime); +} + /* * Note: @fhp can be NULL; in this case, we might have to compose the filehandle * ourselves. @@ -3611,7 +3617,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, goto out; } if (bmval1 & FATTR4_WORD1_TIME_MODIFY) { - status = nfsd4_encode_nfstime4(xdr, &args.stat.mtime); + status = nfsd4_encode_fattr4_time_modify(xdr, &args); if (status) goto out; }