From patchwork Mon Sep 18 14:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13389838 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 E81BCCD37B0 for ; Mon, 18 Sep 2023 15:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229452AbjIRP2W (ORCPT ); Mon, 18 Sep 2023 11:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjIRP15 (ORCPT ); Mon, 18 Sep 2023 11:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25BAEE78 for ; Mon, 18 Sep 2023 08:25:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CDB2C116D2; Mon, 18 Sep 2023 14:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695045670; bh=vVxaXwBNqYVp9Tr8tf6Zt/VPqh7Mco63r7P50T5BHO4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HXUiK6m2/qU9FWltAY3JeohlqlmO7oY3ygZ1wPDDSfJP/WxuU4cWGMR0OPuowcwBi fuEmxvegQ96SqJEWv93O7jyRlRoZ84cXBRNRw71lG/H31im5r/aZRUtaWdlonaFE/R bjLcOb5K4wGV/HWtanomxNpym7PJYQDqdvDgHJisG/mt6gmdmKT8Cm3EtO/7Vl32vH 9HQTMGQfyyrYqX/qqPPwwL1x836klCJ3xSTiqBQL1OpjnoLJmhGIYKGHXTrgfcG/I9 uL/+AGam/jmMkbDd1fD3HNZ+ow8Q+S/W1eKhan8Hf/hMtxLGkX1RX53xrE5OVTjATY DdHklYZgHGKCg== Subject: [PATCH v1 41/52] NFSD: Add nfsd4_encode_fattr4_time_metadata() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 18 Sep 2023 10:01:09 -0400 Message-ID: <169504566918.133720.1802016538751714347.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_METADATA 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 28eb777f82d2..75121b4a6020 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3262,6 +3262,12 @@ static __be32 nfsd4_encode_fattr4_time_delta(struct xdr_stream *xdr, return nfsd4_encode_nfstime4(xdr, &ts); } +static __be32 nfsd4_encode_fattr4_time_metadata(struct xdr_stream *xdr, + const struct nfsd4_fattr_args *args) +{ + return nfsd4_encode_nfstime4(xdr, &args->stat.ctime); +} + /* * Note: @fhp can be NULL; in this case, we might have to compose the filehandle * ourselves. @@ -3600,7 +3606,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, goto out; } if (bmval1 & FATTR4_WORD1_TIME_METADATA) { - status = nfsd4_encode_nfstime4(xdr, &args.stat.ctime); + status = nfsd4_encode_fattr4_time_metadata(xdr, &args); if (status) goto out; }