From patchwork Mon Sep 18 14:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13389816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ECDBC46CA1 for ; Mon, 18 Sep 2023 15:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240762AbjIRPYS (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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; }