Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp79376rdb; Mon, 18 Sep 2023 08:41:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG14q4sTlpIJsPwBNeRWU5IjD5EHe9Cob0m4+iTXx6MYNiRgutzahiv6oLCgc2uYJgxAQBM X-Received: by 2002:a17:90a:2ac9:b0:26f:392f:f901 with SMTP id i9-20020a17090a2ac900b0026f392ff901mr11655852pjg.14.1695051712438; Mon, 18 Sep 2023 08:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695051712; cv=none; d=google.com; s=arc-20160816; b=oL9QSAbpOzpesIb8t3AfgJjV3DeRIST41OlLl8cLqP7xKQPCal16bmtpO7P0gvCRUw QzbU+VZ8mxfPau4cGNHirCUEf/FpxqqYe/8hvdNRScTo1Kb8tZvtRshwceF118JETdLp ALbM7LXzqK0lJQXkM9YNg0Bzs2zlU8AzYPm09D+aTCKo+JIwlfBlVwO8utr7vj+dBFvB 6TQvk/5hppEsZ8Y14DKFp7JIrc8Gq7IHkFheyKdJ4ymo+R4dxqklQLjpz08G03Rg9wiA 7FOn7mOFlMingZ6A3T9yeXIKZJAUfmuipa7CfQbD7zRWyUzBQQBdW66pFwzGSE9bqN6k 97XQ== 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=IgOpo1xLHsq60ZjaZYjFMEO3VSKV/fZPn0vKH5LGPyA=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=R4LdFhLE8SQ/J/6oaCSS7P0UfeDHtujN9Ky4oFaIxsSF9nJZDG2PypDCzYZgqUPgVm MJtW/H4z15JfbIwQ8ESPSKVZvqbBU66hnZneo9SoEDXRpQZD2Dceu3WHJKl7gtzmmiUR Z6LcFXCmWPs/AqIOvh10BGVV/7ojCT+jJPZh4s1hF+X2VD8qJuWDctnyB/+RieUxNTBM Nb+SnvYGAtTk5efFEY4xW+u418JNKK/APsQpL2T6Fg7gMUfS67RBzyQw+IfUEdJZX+wd N8tYFKjWIEYrB5Lp5yiScMr55hRJro4+Hf5dObLO61orl2X9NZ1fUAw88YL5Qh8cXT+F l8xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FGUhh3CO; 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 v15-20020a17090abb8f00b002568a675b65si10409640pjr.141.2023.09.18.08.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 08:41:52 -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=FGUhh3CO; 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 ACF2E81D6BF9; Mon, 18 Sep 2023 08:33:06 -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 S229500AbjIRPcl (ORCPT + 99 others); Mon, 18 Sep 2023 11:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjIRPcV (ORCPT ); Mon, 18 Sep 2023 11:32:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB4D128 for ; Mon, 18 Sep 2023 08:28:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7C11C116B5; Mon, 18 Sep 2023 14:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695045612; bh=oWnM++4sTTDXhDcWv911bJNzVpUnPd9jMvyXntU1aI0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=FGUhh3CONTDUP/aWzCiUjTKjYm1kOMGPxvZ7aoxMihon5JayiUlpOKha+V7OhKM0V V+760dXDp4rVvw8gxnY6Aan0riDyezK/QG/7CUjabLvpBVfrbS0/MUpA90bvMJYDMj fa9r3mbK32p53udUF9gAvTd5qrtj7mdddFtlpvZyHYl+mi9zrjXWwUSiJWTt/SFeFI IS7aXcZaQky+E5nPGgD/SSS6wro6vr3TdGh4Xt2aqm9Sg5jmy3o4+qcXyDhQ94dW8N oE76oEfQIsJExZr+DRqk3YuE/mBnbJwXgzui4TN1Kzp3V5kajprdpg3XnZ3g6glV12 H4sJ7dIgQmVnw== Subject: [PATCH v1 32/52] NFSD: Add nfsd4_encode_fattr4_owner_group() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 18 Sep 2023 10:00:11 -0400 Message-ID: <169504561180.133720.5689851436829082956.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:33:06 -0700 (PDT) From: Chuck Lever Refactor the encoder for FATTR4_OWNER_GROUP 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 11922b18f357..91ac991dea9d 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3200,6 +3200,12 @@ static __be32 nfsd4_encode_fattr4_owner(struct xdr_stream *xdr, return nfsd4_encode_user(xdr, args->rqstp, args->stat.uid); } +static __be32 nfsd4_encode_fattr4_owner_group(struct xdr_stream *xdr, + const struct nfsd4_fattr_args *args) +{ + return nfsd4_encode_group(xdr, args->rqstp, args->stat.gid); +} + /* * Note: @fhp can be NULL; in this case, we might have to compose the filehandle * ourselves. @@ -3494,8 +3500,8 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, goto out; } if (bmval1 & FATTR4_WORD1_OWNER_GROUP) { - status = nfsd4_encode_group(xdr, rqstp, args.stat.gid); - if (status) + status = nfsd4_encode_fattr4_owner_group(xdr, &args); + if (status != nfs_ok) goto out; } if (bmval1 & FATTR4_WORD1_RAWDEV) {