{"id":2234990,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2234990/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-6-libaokun@linux.alibaba.com/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/1.2/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260508121539.4174601-6-libaokun@linux.alibaba.com>","list_archive_url":null,"date":"2026-05-08T12:15:27","name":"[RFC,05/17] ext4: extract block bitmap checksum get and store helpers","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"aeba83a8e1f0ab96794a4cd262d8dad5f61a5f9b","submitter":{"id":92757,"url":"http://patchwork.ozlabs.org/api/1.2/people/92757/?format=json","name":"Baokun Li","email":"libaokun@linux.alibaba.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-6-libaokun@linux.alibaba.com/mbox/","series":[{"id":503377,"url":"http://patchwork.ozlabs.org/api/1.2/series/503377/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=503377","date":"2026-05-08T12:15:22","name":"ext4/lib-crc: LBS performance part 1 - incremental CRC32c for bitmap checksums","version":1,"mbox":"http://patchwork.ozlabs.org/series/503377/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2234990/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2234990/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <SRS0=bvLc=DF=vger.kernel.org=linux-ext4+bounces-16369-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=hhz1eRJA;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=bvlc=df=vger.kernel.org=linux-ext4+bounces-16369-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com","gandalf.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=hhz1eRJA;\n\tdkim-atps=neutral","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16369-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=\"hhz1eRJA\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=115.124.30.110","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.alibaba.com"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBpBX4vKTz1yKd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:21:24 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4gBpBX4PJYz4wJg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:21:24 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4gBpBX4KqLz4wJS; Fri, 08 May 2026 22:21:24 +1000 (AEST)","from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4gBpBR5tc8z4wJg\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 08 May 2026 22:21:19 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 2511230A123D\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  8 May 2026 12:16:17 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 13CDA3DCDB5;\n\tFri,  8 May 2026 12:16:16 +0000 (UTC)","from out30-110.freemail.mail.aliyun.com\n (out30-110.freemail.mail.aliyun.com [115.124.30.110])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 83BC43DBD76;\n\tFri,  8 May 2026 12:16:13 +0000 (UTC)","from\n x31h02109.sqa.na131.tbsite.net(mailfrom:libaokun@linux.alibaba.com\n fp:SMTPD_---0X2XQgob_1778242562 cluster:ay36)\n          by smtp.aliyun-inc.com;\n          Fri, 08 May 2026 20:16:03 +0800"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778242884; cv=pass;\n\tb=renABIoncNb+0kasTM1+MzFWWiDaj5i7F5a0HSW7GlV/6Pj3ObdMLMNXzVKQPHQrVuLTuEY1Rb8ktAzE9smV8zMZRUl5YwQm+Ognt/q5s8ydkAGkHKmpvjm9djD07UFTDwkqTvs0B2/Xmq9Jh3i4iZ0zrOaMPh/6rh8GrJbXJwUW0itg84P4udmpyue+yFYUh5r4fBoBbxH0LY8KfIAEE02uKba24IQCQZKt4S+YL2jYHadV+syTVKjwUXqYmwQKvsCPUW9apUlw6oWSgeHYKM7XLrsTiK8DBdI5I/acwmrdrO/DdQ+JGS4z3JpB02udjOmSOszzpwMoOMtDQA/iNg==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778242575; cv=none;\n b=doyl6c/SCbkkW9IhVSST/WN0pC0naACR7lvfqg+eYJAVG/wXbVX3RFrhgjEXF926aXQKsEC8w86E1DtGgpBNd+LbUCS7Wa5y5i8ZyKUtLavFpPfGuV4P3TwXb8rFoTjwX5oRf+TZ5zprFRfiwWC6qMgtupT4htqj/SThOal4/bA="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778242884; c=relaxed/relaxed;\n\tbh=1Y3Dg8VLiBIuOI2ZnBPqViCvDT9IQnATlwd9T0kLB3w=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Efln7gOffyzsu8EC35U6k5316m4x/Yrc11oY9QixkM3WIMmXtTbAdX9xRNleX4D+c9SlHGCMUhOZxgvSnuDg2M/Omzf2+VQXhg3txHbE1Wkx3XBTjLm+WDXLkqDF4m35RYHiRv+VB4EO5Xcf7XcNN/IAciHqnm8lWvX6srpFErWEvcxaP0wo+gVJPhECxTlEVuvq8ypS8NMKM/fbtGVI94BT16xKndVT87k5nj72STJhaR1+AgoZtGA71i1m+HWv1A8SUz2mJuk5v8io0KQmKHc8Q5Wde15MfHtXuzaY6MlNFa/uxjQr8Oqte4yHHobBf9kkggfo7oFww3fnTGn+Bg==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778242575; c=relaxed/simple;\n\tbh=olkM4+FWlC4BLP/SL9xpg/LejXRBiGobEelmKBOsTW4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=RYfRMFmdcgzCUJ8khwVgjHPpy6aMm/R79xWa+sIBq0lOlipQ5znd7COKtdQfkYGR9IBWbEyzKmi8sCO7O2uVDrsnh7bvfdLSxXLQHfvOn/EDPUxl4j4ci6hGWoDGpTkOxqqD1RWrXVy3SeTPsYUunwRhkKIXPQoLEg2se8DiGCQ="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n dkim=pass (1024-bit key;\n unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com\n header.a=rsa-sha256 header.s=default header.b=hhz1eRJA; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16369-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.alibaba.com;\n spf=pass smtp.mailfrom=linux.alibaba.com;\n dkim=pass (1024-bit key) header.d=linux.alibaba.com\n header.i=@linux.alibaba.com header.b=hhz1eRJA;\n arc=none smtp.client-ip=115.124.30.110"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1778242564; h=From:To:Subject:Date:Message-ID:MIME-Version;\n\tbh=1Y3Dg8VLiBIuOI2ZnBPqViCvDT9IQnATlwd9T0kLB3w=;\n\tb=hhz1eRJACJfkXsCdLfROL2V9PrNYZhdf5Jr+ECV+njfrKA33hwW0yVnYTlJ9EE6Ejw3PCEoqiUT0Q5hBN0BZQPy2/BircuTocSHTrYkj2kjkXE7RRNGObweV/TzjCmI6I5xRFHmBFVBVv4yjy2PS1KZUPTsANg9iSzRbkfRls8s=","X-Alimail-AntiSpam":"\n AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045133197;MF=libaokun@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0X2XQgob_1778242562;","From":"Baokun Li <libaokun@linux.alibaba.com>","To":"linux-ext4@vger.kernel.org","Cc":"linux-crypto@vger.kernel.org,\n\tebiggers@kernel.org,\n\tardb@kernel.org,\n\ttytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tjack@suse.cz,\n\tyi.zhang@huawei.com,\n\tojaswin@linux.ibm.com,\n\tritesh.list@gmail.com,\n\tBaokun Li <libaokun@linux.alibaba.com>","Subject":"[PATCH RFC 05/17] ext4: extract block bitmap checksum get and store\n helpers","Date":"Fri,  8 May 2026 20:15:27 +0800","Message-ID":"<20260508121539.4174601-6-libaokun@linux.alibaba.com>","X-Mailer":"git-send-email 2.43.7","In-Reply-To":"<20260508121539.4174601-1-libaokun@linux.alibaba.com>","References":"<20260508121539.4174601-1-libaokun@linux.alibaba.com>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Spam-Status":"No, score=-8.7 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tHEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,\n\tSPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_DKIM_WL autolearn=disabled\n\tversion=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"Add ext4_block_bitmap_csum_get() and ext4_block_bitmap_csum_store()\nhelpers, and use EXT4_DESC_SIZE(sb) instead of sbi->s_desc_size for\nconsistency. No functional change.\n\nSigned-off-by: Baokun Li <libaokun@linux.alibaba.com>\n---\n fs/ext4/bitmap.c | 31 ++++++++++++++++++++++---------\n 1 file changed, 22 insertions(+), 9 deletions(-)","diff":"diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c\nindex 87760fabdd2e..46affc9e80ca 100644\n--- a/fs/ext4/bitmap.c\n+++ b/fs/ext4/bitmap.c\n@@ -58,11 +58,29 @@ void ext4_inode_bitmap_csum_set(struct super_block *sb,\n \t\tgdp->bg_inode_bitmap_csum_hi = cpu_to_le16(csum >> 16);\n }\n \n+static inline __u32 ext4_block_bitmap_csum_get(struct super_block *sb,\n+\t\t\t\t\t       struct ext4_group_desc *gdp)\n+{\n+\t__u32 csum = le16_to_cpu(gdp->bg_block_bitmap_csum_lo);\n+\n+\tif (EXT4_DESC_SIZE(sb) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_END)\n+\t\tcsum |= (__u32)le16_to_cpu(gdp->bg_block_bitmap_csum_hi) << 16;\n+\treturn csum;\n+}\n+\n+static inline void ext4_block_bitmap_csum_store(struct super_block *sb,\n+\t\t\t\t\t\tstruct ext4_group_desc *gdp,\n+\t\t\t\t\t\t__u32 csum)\n+{\n+\tgdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF);\n+\tif (EXT4_DESC_SIZE(sb) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_END)\n+\t\tgdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16);\n+}\n+\n int ext4_block_bitmap_csum_verify(struct super_block *sb,\n \t\t\t\t  struct ext4_group_desc *gdp,\n \t\t\t\t  struct buffer_head *bh)\n {\n-\t__u32 hi;\n \t__u32 provided, calculated;\n \tstruct ext4_sb_info *sbi = EXT4_SB(sb);\n \tint sz = EXT4_CLUSTERS_PER_GROUP(sb) / 8;\n@@ -70,12 +88,9 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb,\n \tif (!ext4_has_feature_metadata_csum(sb))\n \t\treturn 1;\n \n-\tprovided = le16_to_cpu(gdp->bg_block_bitmap_csum_lo);\n+\tprovided = ext4_block_bitmap_csum_get(sb, gdp);\n \tcalculated = ext4_chksum(sbi->s_csum_seed, (__u8 *)bh->b_data, sz);\n-\tif (sbi->s_desc_size >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_END) {\n-\t\thi = le16_to_cpu(gdp->bg_block_bitmap_csum_hi);\n-\t\tprovided |= (hi << 16);\n-\t} else\n+\tif (EXT4_DESC_SIZE(sb) < EXT4_BG_BLOCK_BITMAP_CSUM_HI_END)\n \t\tcalculated &= 0xFFFF;\n \n \treturn provided == calculated;\n@@ -93,7 +108,5 @@ void ext4_block_bitmap_csum_set(struct super_block *sb,\n \t\treturn;\n \n \tcsum = ext4_chksum(sbi->s_csum_seed, (__u8 *)bh->b_data, sz);\n-\tgdp->bg_block_bitmap_csum_lo = cpu_to_le16(csum & 0xFFFF);\n-\tif (sbi->s_desc_size >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_END)\n-\t\tgdp->bg_block_bitmap_csum_hi = cpu_to_le16(csum >> 16);\n+\text4_block_bitmap_csum_store(sb, gdp, csum);\n }\n","prefixes":["RFC","05/17"]}