Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp135537rdb; Mon, 18 Sep 2023 10:12:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGceJD3WpevzIRnYJ64kjjVxmQk0KkDVMdVG+u4ulnzxIDKwFFjvJT+0AUKMoxhvQb+puS9 X-Received: by 2002:a05:6a21:718b:b0:154:a9bc:12ca with SMTP id wq11-20020a056a21718b00b00154a9bc12camr8306676pzb.26.1695057140181; Mon, 18 Sep 2023 10:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695057140; cv=none; d=google.com; s=arc-20160816; b=mojUZY8DAEJxdEEuMe9x2OHjd43w/atVcxz8TgpGKs2YaxPPMtHZ16CMGIjie+YPFu 4+Hsqez7Us13JvO/FR9O3ntGlzxPFN0r7/UoqiW6uRduvrdXkaP8T+QMApWOft5FZT7s cIC7zTqFWeb/RcW7tWc7+o/qhEzYJwajCC5kZpEye2qaLJr2523KRQwAtT1z7CUlxcTM 8jbgQoi+SxBntATpKMTNDH7LZ1iXYgkTYl65sqS1g3O4PF1GUE+0SSawQvb/gh46VnPb +BciePpVskJZCt0DV6y8MVupjw2NQ9Y4jxd8C0m91g+E2nMpEvxIOScSSf6nU8oRqHG5 /UXg== 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:message-id:date:cc:to:from:subject:dkim-signature; bh=Boa0RydSGYAu3m3AnOM2vXhVX2sLkYT/U9M2bDccijI=; fh=v8a13lpFSZWlL4AptTEJnmXnlqoWXhGCGCgvrcnCT9I=; b=xbhwnRc/iiLESy4aT2+0hwPokZZw90CY49Gec5MFPBQC/ZtzXLlQuWWOU08JolFVmA uV49j5ENhe/puxTxMMlnRhjr5Qotqj+9qdlC8NU/pgODEk1l7QmILk8I+oJHL5k7fwqZ 1lR6dC4Q7p5quf0tfcM2NnImTewb0Nj4sXOB7uL0G3Ap9vnosbhg5XOejRJRXpBde9KG /u0TY1b8I11m1KJRoaSQoqmGTDJney3XHUo1jSLZETAdAcPqprn3Fs5T2NMhQ+3t024v 1ZvbdnmNebPM77+mqufWdHhJ111WtswNjPps9HtHNRQrS4a8GqlU9ORdf/unScFF9kZN DlNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WAmhYe3h; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i189-20020a6387c6000000b0057406f52467si8100930pge.517.2023.09.18.10.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 10:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WAmhYe3h; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id C2FE28097A67; Mon, 18 Sep 2023 09:26:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjIRQ06 (ORCPT + 99 others); Mon, 18 Sep 2023 12:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbjIRQ0Z (ORCPT ); Mon, 18 Sep 2023 12:26:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D45FD282B7 for ; Mon, 18 Sep 2023 09:23:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5B1DC433B6; Mon, 18 Sep 2023 13:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695045408; bh=dQJeM9YgMqokf6Vk+HE1/z4jNWMeQ3bLqeKjuu6O9s4=; h=Subject:From:To:Cc:Date:From; b=WAmhYe3hSx/HnkXk30CSvzLBceEtsDY2MfEwMVJFDimytfaifnnalI8Pq49Ec27xi wb0RzFT/sHh1g+m/0pMdVffGrWUMjteUlzpUli9XIuT2q4p3acKJ2p/YUtojNAVHGc ACJPv8rU6ewMUqd+Qg1O3E1nbpw1H4G1LTXP/zQd3mgtgviQy3RpWeXhmpssGk6AMb w3WuGrgW/XBLOfSeyMSPg9j6g3ikIFuD0WGMkHeC7ZDr+pyTel4t0wVs9nqNrRoJXX HaI00ROX42mXQh0E4wr+YOxQTUFXL6hq6IItdhBUch5cKeE00RDdvY+4qEvmfMd/K+ 00oshMYC8nukg== Subject: [PATCH v1 00/52] Modernize nfsd4_encode_fattr() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 18 Sep 2023 09:56:47 -0400 Message-ID: <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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 09:26:59 -0700 (PDT) This series restructures the server's fattr4 encoder. It is largely a maintenance improvement (ie, only 2nd-order benefits). There are no new features or performance benefits, and I hope there will be no changes in behavior. The goals: * Better alignment with spec * Easier to read and audit * Less brittle * Some code de-duplication This series applies to v6.6-rc2. Minor adjustment will be needed to apply it to nfsd-next. I apologize for the number of patches, but each of them (with only a couple of exceptions) is small and mechanical, and therefore easily digested. A branch containing these patches is available in this repo: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git See the "nfsd4-encoder-overhaul" branch. --- Chuck Lever (52): NFSD: Add simple u32, u64, and bool encoders NFSD: Rename nfsd4_encode_bitmap() NFSD: Clean up nfsd4_encode_setattr() NFSD: Add struct nfsd4_fattr_args NFSD: Add nfsd4_encode_fattr4__true() NFSD: Add nfsd4_encode_fattr4__false() NFSD: Add nfsd4_encode_fattr4_supported_attrs() NFSD: Add nfsd4_encode_fattr4_type() NFSD: Add nfsd4_encode_fattr4_fh_expire_type() NFSD: Add nfsd4_encode_fattr4_change() NFSD: Add nfsd4_encode_fattr4_size() NFSD: Add nfsd4_encode_fattr4_fsid() NFSD: Add nfsd4_encode_fattr4_lease_time() NFSD: Add nfsd4_encode_fattr4_rdattr_error() NFSD: Add nfsd4_encode_fattr4_aclsupport() NFSD: Add nfsd4_encode_nfsace4() NFSD: Add nfsd4_encode_fattr4_acl() NFSD: Add nfsd4_encode_fattr4_filehandle() NFSD: Add nfsd4_encode_fattr4_fileid() NFSD: Add nfsd4_encode_fattr4_files_avail() NFSD: Add nfsd4_encode_fattr4_files_free() NFSD: Add nfsd4_encode_fattr4_files_total() NFSD: Add nfsd4_encode_fattr4_fs_locations() NFSD: Add nfsd4_encode_fattr4_maxfilesize() NFSD: Add nfsd4_encode_fattr4_maxlink() NFSD: Add nfsd4_encode_fattr4_maxname() NFSD: Add nfsd4_encode_fattr4_maxread() NFSD: Add nfsd4_encode_fattr4_maxwrite() NFSD: Add nfsd4_encode_fattr4_mode() NFSD: Add nfsd4_encode_fattr4_numlinks() NFSD: Add nfsd4_encode_fattr4_owner() NFSD: Add nfsd4_encode_fattr4_owner_group() NFSD: Add nfsd4_encode_fattr4_rawdev() NFSD: Add nfsd4_encode_fattr4_space_avail() NFSD: Add nfsd4_encode_fattr4_space_free() NFSD: Add nfsd4_encode_fattr4_space_total() NFSD: Add nfsd4_encode_fattr4_space_used() NFSD: Add nfsd4_encode_fattr4_time_access() NFSD: Add nfsd4_encode_fattr4_time_create() NFSD: Add nfsd4_encode_fattr4_time_delta() NFSD: Add nfsd4_encode_fattr4_time_metadata() NFSD: Add nfsd4_encode_fattr4_time_modify() NFSD: Add nfsd4_encode_fattr4_mounted_on_fileid() NFSD: Add nfsd4_encode_fattr4_fs_layout_types() NFSD: Add nfsd4_encode_fattr4_layout_types() NFSD: Add nfsd4_encode_fattr4_layout_blksize() NFSD: Add nfsd4_encode_fattr4_suppattr_exclcreat() NFSD: Add nfsd4_encode_fattr4_sec_label() NFSD: Add nfsd4_encode_fattr4_xattr_support() NFSD: Copy FATTR4 bit number definitions from RFCs NFSD: Use a bitmask loop to encode FATTR4 results NFSD: Rename nfsd4_encode_fattr() fs/nfsd/nfs4xdr.c | 1419 +++++++++++++++++++++----------------- fs/nfsd/nfsfh.c | 2 +- fs/nfsd/nfsfh.h | 3 +- fs/nfsd/xdr4.h | 119 ++++ include/linux/iversion.h | 2 +- include/linux/nfs4.h | 260 +++++-- 6 files changed, 1085 insertions(+), 720 deletions(-) -- Chuck Lever