From patchwork Thu Sep 28 13:16:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 146110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3310466vqu; Thu, 28 Sep 2023 06:26:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPM0wTOVXo1mCCJnK3t2NDfSHZQWwVOwD2PTLOQp6vEWWYyZKodhPSDkeEaxxDG5aXb50E X-Received: by 2002:a17:902:7445:b0:1c5:ce3c:c399 with SMTP id e5-20020a170902744500b001c5ce3cc399mr1270108plt.39.1695907568445; Thu, 28 Sep 2023 06:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695907568; cv=none; d=google.com; s=arc-20160816; b=UUjIvW7XrA0DRPT4acHVSoQfJu3r5nJLuED490EwR0KVbVkzW7zUb6f3Y93nN8W1Wc mlhAsOnoECD7s5vroUvDfNhX279DM/Fy6rMI5aFzSpFvfgL1iP+Nt2AVEQ5/nEovJ6u3 d00+PkyZ4CxC3p9qzZwcwQMs6a5iDXE8mLrQuuLnTXml6vuodvjNcchulK1iJqSrUtnC a8Yr4rE6cMz+2fobcNk7BsdOVNSp+vBuTJ4fp4uHguJSnJUpJDLWJ+FijKoWzc9cU+nL OVDIszFBy3COWdRatHAd5xgpYWMaR3ewrQDPzscwT9T9H/gak4OT/fgV0rWwu8bt5uyr 8Q8A== 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=763bqg0oTyeqAH7onYPjZW0Gts6hq6OR+fjmprkCyqA=; fh=z75JJEiZ1wpT4hIA7TYzTVjm488AiLUnzj+UpTp0s0w=; b=oiqYM2/0U4ruOSi1YXn7VS9dMqKOM545jNVXPvoyYc+meh7Lq7moOsXOmvNN82T96Y h4DbgMYEXZOxOGc0vdZ+usH0Qby/XqIU+fvmwwobUH2RgM4WQMMhBB4wM7C5KyrZKWbp UBOZj/7PZyFNj64vDFeIo5f2otUjqWLXTbyJ1cSJGTg3qTUHOK3l0w+wcRAoksBiYN/2 vv3fBgC2Qf+Ppscaupy86Bc6OpYNA5u8geli/mUXp+hfo6Mdk32vr9o99MSzGOYrmmEA pTSjLQMLRUTuebv6xjWMrumKNzUm2E08RH16bCVBeSIH/+3NzhqWlAzZG5X/MfGVDqFa 3wPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id kr6-20020a170903080600b001c1eed8a336si16999174plb.167.2023.09.28.06.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 06:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7B378801D672; Thu, 28 Sep 2023 06:16:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbjI1NQI (ORCPT + 21 others); Thu, 28 Sep 2023 09:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232199AbjI1NQG (ORCPT ); Thu, 28 Sep 2023 09:16:06 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1239DF5; Thu, 28 Sep 2023 06:16:03 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Vt1nuL3_1695906960; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0Vt1nuL3_1695906960) by smtp.aliyun-inc.com; Thu, 28 Sep 2023 21:16:01 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: huyue2@coolpad.com, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] erofs: update documentation Date: Thu, 28 Sep 2023 21:16:00 +0800 Message-Id: <20230928131600.84701-1-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 06:16:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778287974627799103 X-GMAIL-MSGID: 1778287974627799103 - update new features like bloom filter and DEFLATE. - add documentation for the long xattr name prefixes, which was landed upstream since v6.4. Signed-off-by: Jingbo Xu --- Documentation/filesystems/erofs.rst | 40 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/erofs.rst b/Documentation/filesystems/erofs.rst index 4654ee57c1d5..522183737be6 100644 --- a/Documentation/filesystems/erofs.rst +++ b/Documentation/filesystems/erofs.rst @@ -58,12 +58,14 @@ Here are the main features of EROFS: - Support extended attributes as an option; + - Support a bloom filter that speeds up negative extended attribute lookups; + - Support POSIX.1e ACLs by using extended attributes; - Support transparent data compression as an option: - LZ4 and MicroLZMA algorithms can be used on a per-file basis; In addition, - inplace decompression is also supported to avoid bounce compressed buffers - and page cache thrashing. + LZ4, MicroLZMA and DEFLATE algorithms can be used on a per-file basis; In + addition, inplace decompression is also supported to avoid bounce compressed + buffers and unnecessary page cache thrashing. - Support chunk-based data deduplication and rolling-hash compressed data deduplication; @@ -268,6 +270,38 @@ details.) By the way, chunk-based files are all uncompressed for now. +Long extended attribute name prefixes +------------------------------------- +There are use cases that extended attributes with different values can have +only a few common prefixes (such as overlayfs xattrs). The predefined prefixes +works inefficiently in both image size and runtime performance in such cases. + +The long xattr name prefixes feature is introduced to address this issue. The +overall idea is that, apart from the existing predefined prefixes, the xattr +entry could also refer to user specified long xattr name prefixes, e.g. +"trusted.overlay.". + +When referring to a long xattr name prefix, the highest bit (bit 7) of +erofs_xattr_entry.e_name_index is set, while the lower bits (bit 0-6) as a whole +represents the index of the referred long name prefix among all long name +prefixes. Therefore, only the trailing part of the name apart from the long +xattr name prefix is stored in erofs_xattr_entry.e_name, which could be empty if +the full xattr name matches exactly as its long xattr name prefix. + +All long xattr prefixes are stored one by one in the packed inode as long as +the packed inode is valid, or meta inode otherwise. The xattr_prefix_count (of +on-disk superblock) indicates the total number of the long xattr name prefixes, +while (xattr_prefix_start * 4) indicates the start offset of long name prefixes +in the packed/meta inode. Note that, long extended attribute name prefixes is +disabled if xattr_prefix_count is 0. + +Each long name prefix is stored in the format: ALIGN({__le16 len, data}, 4), +where len represents the total size of the data part. The data part is actually +represented by 'struct erofs_xattr_long_prefix', where base_index represents the +index of the predefined xattr name prefix, e.g. EROFS_XATTR_INDEX_TRUSTED for +"trusted.overlay." long name prefix, while the infix string kepts the string +after stripping the short prefix, e.g. "overlay." for the example above. + Data compression ---------------- EROFS implements fixed-sized output compression which generates fixed-sized