From patchwork Thu Jun 1 02:43:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 10133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp13333vqr; Wed, 31 May 2023 19:58:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IyhTebLylFWrAuUqQA2MNgricjoRrxDXugOy01J3/nmVGEm981Bb97Do2gQQCFY8xADQ7 X-Received: by 2002:a05:6a20:440d:b0:106:92a:37ae with SMTP id ce13-20020a056a20440d00b00106092a37aemr410197pzb.30.1685588283633; Wed, 31 May 2023 19:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685588283; cv=none; d=google.com; s=arc-20160816; b=x02Ky2ksqS2+UfFzsxVDTbyZhliuAoQaUi1G+UGECUmDj8B9Cwmhbz+c0iiJgbA+5/ fYD3+yY53IjsLB79SMt+8WBF3YOR9egjuwb4w0Oktmz9NrCV+RXTUU3/7DvzGAnfXF8y Esa/VCnrL6Nbr4k652dE0NIvMV410yTx3i/DAn0v5ddBTRf0RySMl1cpwhdP0pUmUAn9 cwDL5sTVVn4OqgIDGe1j+zfXDrRLq8/Sfc4L+BBDm3BYF0LqadTVFmLO2IgSVC5omLv5 ga3axdh1VNvM/pOZ58/+YS+11Ux4FGUkvJVTTT1NVrWhiih1ONAF16/1m94nL0VieoBw M6yg== 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 :message-id:date:subject:cc:to:from; bh=/C0esVZKuYtKMLwOxR/CY1AKP8bYCLkrQs1hMpkIFAE=; b=goWxhdEc1jqiTkayDtywjzPfVVfL8fgICAFty7BaBleEBjbu5TZcXyxlE7MvMIBggi DGrmNePjF6S6y3kiZlF2lH5n1Hazdda4rKHBtd2BOAzsArdzUC3XL5ZaT1dYx12TQo3Z HCx9l+3FQulIO/Hnnu7/nAVYzLvrhUTMg37jLpj7ClQsAlW/WRQCexUZV03eS4oSG66K B+MoZfNtMmtsq/AmIgaHi3hkh4sUFi34qvWAeBHGFXav5rQYb7ES8Zaw6JEDQ+oyT9VY cFFPRs0Izuldb8l8iOiIVP/BxZu3ibD9m84/350d+z3L9Rzk46P7/XVxUtG433G/E/rJ cv2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a637e11000000b00528519a4371si2029486pgc.516.2023.05.31.19.57.49; Wed, 31 May 2023 19:58:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbjFACny (ORCPT + 99 others); Wed, 31 May 2023 22:43:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbjFACnw (ORCPT ); Wed, 31 May 2023 22:43:52 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 417FD124 for ; Wed, 31 May 2023 19:43:51 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R341e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Vk-8yUI_1685587427; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vk-8yUI_1685587427) by smtp.aliyun-inc.com; Thu, 01 Jun 2023 10:43:48 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v5 0/6] erofs: cleanup of xattr handling Date: Thu, 1 Jun 2023 10:43:41 +0800 Message-Id: <20230601024347.108469-1-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767467420366535977?= X-GMAIL-MSGID: =?utf-8?q?1767467420366535977?= changes since v4: - patch 1: make conversions from erofs_read_metabuf() in xattr.c to "erofs_init_metabuf() + erofs_bread()" a separate patch - patch 6: add "bool copy" function parameter to erofs_xattr_body(), and thus make erofs_xattr_namematch() and erofs_xattr_copy() inlined inside erofs_xattr_body() changes since v3: - patch 1: make a unified erofs_xattr_iter_fixup() API with newly introduced "bool nospan" argument; call erofs_init_metabuf() and erofs_bread() separately instead of erofs_read_metabuf() - patch 2: avoid duplicated strlen() calculation in erofs_getxattr(); no need zeroing other fields when initializing 'struct erofs_xattr_iter' - patch 4: don't explode 'struct erofs_xattr_iter' with inode/getxattr fields; instead pass inode/getxattr parameters through function parameters of erofs_iter_[inline|shared]_xattr() - patch 5: don't explode 'struct erofs_xattr_iter' with remaining field; instead calculate and check the remaining inside erofs_iter_inline_xattr() changes since v2: - rebase to v6.4-rc2 - passes xattr tests (erofs/019,020,021) of erofs-utils [1] [1] https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/log/?h=experimental-tests v4: https://lore.kernel.org/all/20230531031330.3504-1-jefflexu@linux.alibaba.com/ v3: https://lore.kernel.org/lkml/20230518024551.123990-1-jefflexu@linux.alibaba.com/ v2: https://lore.kernel.org/all/20230330082910.125374-1-jefflexu@linux.alibaba.com/ v1: https://lore.kernel.org/all/20230323000949.57608-1-jefflexu@linux.alibaba.com/ Jingbo Xu (6): erofs: convert erofs_read_metabuf() to erofs_bread() for xattr erofs: enhance erofs_xattr_iter_fixup() helper erofs: unify xattr_iter structures erofs: make the size of read data stored in buffer_ofs erofs: unify inline/share xattr iterators for listxattr/getxattr erofs: use separate xattr parsers for listxattr/getxattr fs/erofs/xattr.c | 673 ++++++++++++++++++----------------------------- 1 file changed, 254 insertions(+), 419 deletions(-)