Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp700rwr; Thu, 4 May 2023 13:50:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SqzdJ9nazDWjABK/2T99MLaQUGbNvf5kf2jnywxSKO94//Vv3VGBi54WPPBTrpq23Wdoa X-Received: by 2002:a17:90a:6a8e:b0:247:5bb4:f445 with SMTP id u14-20020a17090a6a8e00b002475bb4f445mr3186049pjj.29.1683233444660; Thu, 04 May 2023 13:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683233444; cv=none; d=google.com; s=arc-20160816; b=KplyaZfvDMs2Lhlg/MuCc+zTGfQzL5A4qPxh2AuVnmo8e9t9Kz16eUgN8ltuVp/MFL yIdXzDvN/obIbrIiynLU2/lkTBnwv6vscM2tuAqCBOfOjig2tHMuwekDImw3W7JCyoGP 0GYG7nyU6Nry2YWy4yQ4UZzBiJ2+oQ9InSU5C3sjyZcJlrujwuO1WmFtKA/nXWiy/Onn 8BCUUOUqkov/Tpdd6bjcju/NtQyFQ6AMc/+3ODeVtdUqPL4GzCAcpgLc3BVCdIKsolMd xTub7cpYacZktz+4UzbHSv8eB5XZC5zKYoTtvqLaA8OaCcsSm0v446bGn9MBLiPyJrjR itAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Tl9sOwpmZtAIzMhRldHJXwk0xk5KYRO6ULf5oKblWEU=; b=mPq3OMHwj3kwQTZxucdtU75yXbSw9gsopeX00tQjGlyoTpUbIf1ftU0RfJHuRkA6T0 ang4iMDer8jEkvwwRyimc/nRwfXSh+ny+NtvnHQvyJ9zq4RFisLHoUJMc8GOu7V++FGx WKVxVKeh+PhOTHL1xvlHqEj01RVbeTvbLwp7Ny7WWb1GLRIlSLKSje9day26fAE8cUkx 24Cdg3b5KyPC97RMXmEkOJ4jV4vfNGp3pp78NfxMfMFsniSrHRr7e5s9kUNrKM88oSXR D9TBQfoCQDWSM9nkygTE4vVvNAbK1mYNYilkbdYxags5kCZNAYNmn4zKJTOpZZXNOFo1 5afw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FV3LrDJi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw1-20020a17090b180100b0024b60d77608si15099512pjb.30.2023.05.04.13.50.32; Thu, 04 May 2023 13:50:44 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FV3LrDJi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjEDUuM (ORCPT + 99 others); Thu, 4 May 2023 16:50:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231316AbjEDUuB (ORCPT ); Thu, 4 May 2023 16:50:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF8FC11D80 for ; Thu, 4 May 2023 13:49:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 25E3D639C5 for ; Thu, 4 May 2023 20:47:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F119C433D2; Thu, 4 May 2023 20:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683233236; bh=myqIA0BbvrYLcP6QStGiaNN5xaenVGZ7FwTcgCHdxh4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FV3LrDJilAvDIxnPHKpm00WaRUVVDsyNhfA9h+uFKPXiSpV46e77sJYC/u2YlY5Q/ RH7b0NMWOeN2xI1eIHCT5Q2DHl9AG8pARC4vmLvFBZdT99q0B9AzTdEdbdSWygCGPf T1jr+S1wpD3f8WJwxZ9QxOcniHQw82oHT9SjRygcL0n2PJe+9mtrePKWxFdgk62nEo KXIkBrt4+ZrZhKgw/WP/8+1ZQEmKWDC/kZzLphIVBV1k6PGsFHfidLKLdOvFgE2YHq frrZiMwdZlAbDxCAnSZHjmETQ6f9M7ILFCdyKJPcbHBpIQEwifQqNhj5drzxQb0yFf Kh9bh0WvvLN5A== From: Anna Schumaker Date: Thu, 04 May 2023 16:47:15 -0400 Subject: [PATCH 5/6] NFSv4.2: Clean up xattr size macros MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230504-xattr-ctime-v1-5-ac3fc5a00942@Netapp.com> References: <20230504-xattr-ctime-v1-0-ac3fc5a00942@Netapp.com> In-Reply-To: <20230504-xattr-ctime-v1-0-ac3fc5a00942@Netapp.com> To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, Anna Schumaker X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5187; i=Anna.Schumaker@Netapp.com; h=from:subject:message-id; bh=x0I57N3cKS5WzOUXTzceP0S6UCKe81kc1ZVKdNqosZ0=;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SCC_BODY_TEXT_LINE 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 From: Anna Schumaker Fold them into the other NFS v4.2 operations in the right spots and adjust spacing to keep the same style. Signed-off-by: Anna Schumaker --- fs/nfs/nfs42xdr.c | 96 +++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 1d74135715c5..215b8700e504 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -7,6 +7,9 @@ #include "nfs42.h" +/* Not limited by NFS itself, limited by the generic xattr code */ +#define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX) + #define encode_fallocate_maxsz (encode_stateid_maxsz + \ 2 /* offset */ + \ 2 /* length */) @@ -89,6 +92,18 @@ 2 /* dst offset */ + \ 2 /* count */) #define decode_clone_maxsz (op_decode_hdr_maxsz) +#define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \ + nfs4_xattr_name_maxsz) +#define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz) +#define encode_setxattr_maxsz (op_encode_hdr_maxsz + \ + 1 + nfs4_xattr_name_maxsz + 1) +#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) +#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1) +#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1) +#define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \ + nfs4_xattr_name_maxsz) +#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \ + decode_change_info_maxsz) #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ encode_sequence_maxsz + \ @@ -186,55 +201,38 @@ decode_putfh_maxsz + \ decode_clone_maxsz + \ decode_getattr_maxsz) - -/* Not limited by NFS itself, limited by the generic xattr code */ -#define nfs4_xattr_name_maxsz XDR_QUADLEN(XATTR_NAME_MAX) - -#define encode_getxattr_maxsz (op_encode_hdr_maxsz + 1 + \ - nfs4_xattr_name_maxsz) -#define decode_getxattr_maxsz (op_decode_hdr_maxsz + 1 + pagepad_maxsz) -#define encode_setxattr_maxsz (op_encode_hdr_maxsz + \ - 1 + nfs4_xattr_name_maxsz + 1) -#define decode_setxattr_maxsz (op_decode_hdr_maxsz + decode_change_info_maxsz) -#define encode_listxattrs_maxsz (op_encode_hdr_maxsz + 2 + 1) -#define decode_listxattrs_maxsz (op_decode_hdr_maxsz + 2 + 1 + 1 + 1) -#define encode_removexattr_maxsz (op_encode_hdr_maxsz + 1 + \ - nfs4_xattr_name_maxsz) -#define decode_removexattr_maxsz (op_decode_hdr_maxsz + \ - decode_change_info_maxsz) - -#define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \ - encode_sequence_maxsz + \ - encode_putfh_maxsz + \ - encode_getxattr_maxsz) -#define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \ - decode_sequence_maxsz + \ - decode_putfh_maxsz + \ - decode_getxattr_maxsz) -#define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \ - encode_sequence_maxsz + \ - encode_putfh_maxsz + \ - encode_setxattr_maxsz) -#define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \ - decode_sequence_maxsz + \ - decode_putfh_maxsz + \ - decode_setxattr_maxsz) -#define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \ - encode_sequence_maxsz + \ - encode_putfh_maxsz + \ - encode_listxattrs_maxsz) -#define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \ - decode_sequence_maxsz + \ - decode_putfh_maxsz + \ - decode_listxattrs_maxsz) -#define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \ - encode_sequence_maxsz + \ - encode_putfh_maxsz + \ - encode_removexattr_maxsz) -#define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \ - decode_sequence_maxsz + \ - decode_putfh_maxsz + \ - decode_removexattr_maxsz) +#define NFS4_enc_getxattr_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ + encode_putfh_maxsz + \ + encode_getxattr_maxsz) +#define NFS4_dec_getxattr_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ + decode_putfh_maxsz + \ + decode_getxattr_maxsz) +#define NFS4_enc_setxattr_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ + encode_putfh_maxsz + \ + encode_setxattr_maxsz) +#define NFS4_dec_setxattr_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ + decode_putfh_maxsz + \ + decode_setxattr_maxsz) +#define NFS4_enc_listxattrs_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ + encode_putfh_maxsz + \ + encode_listxattrs_maxsz) +#define NFS4_dec_listxattrs_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ + decode_putfh_maxsz + \ + decode_listxattrs_maxsz) +#define NFS4_enc_removexattr_sz (compound_encode_hdr_maxsz + \ + encode_sequence_maxsz + \ + encode_putfh_maxsz + \ + encode_removexattr_maxsz) +#define NFS4_dec_removexattr_sz (compound_decode_hdr_maxsz + \ + decode_sequence_maxsz + \ + decode_putfh_maxsz + \ + decode_removexattr_maxsz) /* * These values specify the maximum amount of data that is not -- 2.40.1