Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234998/?format=api
{ "id": 2234998, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234998/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-18-libaokun@linux.alibaba.com/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/1.2/projects/8/?format=api", "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-18-libaokun@linux.alibaba.com>", "list_archive_url": null, "date": "2026-05-08T12:15:39", "name": "[RFC,17/17] ext4: add ext4_get_flex_group() helper to simplify flex group lookups", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "531ad1e7c7b881a1815f0f4eb1f4657db7a2e99c", "submitter": { "id": 92757, "url": "http://patchwork.ozlabs.org/api/1.2/people/92757/?format=api", "name": "Baokun Li", "email": "libaokun@linux.alibaba.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260508121539.4174601-18-libaokun@linux.alibaba.com/mbox/", "series": [ { "id": 503377, "url": "http://patchwork.ozlabs.org/api/1.2/series/503377/?format=api", "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/2234998/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234998/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=WTgU=DF=vger.kernel.org=linux-ext4+bounces-16379-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=Aw4Wh/zW;\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=wtgu=df=vger.kernel.org=linux-ext4+bounces-16379-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::12fc:5321\"\n 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=Aw4Wh/zW;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16379-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=\"Aw4Wh/zW\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=115.124.30.98", "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 4gBpD80FzJz1yKd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:22:48 +1000 (AEST)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4gBpD76sbYz4wJS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:22:47 +1000 (AEST)", "by gandalf.ozlabs.org (Postfix)\n\tid 4gBpD76nYzz4wJg; Fri, 08 May 2026 22:22:47 +1000 (AEST)", "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4gBpD43fQkz4wJS\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 08 May 2026 22:22:44 +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 DED0D30AC10C\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 8 May 2026 12:16:30 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AA98F396D15;\n\tFri, 8 May 2026 12:16:21 +0000 (UTC)", "from out30-98.freemail.mail.aliyun.com\n (out30-98.freemail.mail.aliyun.com [115.124.30.98])\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 E4F453DB63C;\n\tFri, 8 May 2026 12:16:15 +0000 (UTC)", "from\n x31h02109.sqa.na131.tbsite.net(mailfrom:libaokun@linux.alibaba.com\n fp:SMTPD_---0X2XQgru_1778242572 cluster:ay36)\n by smtp.aliyun-inc.com;\n Fri, 08 May 2026 20:16:13 +0800" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1778242967; cv=pass;\n\tb=jK/RxpzDCSm8o5aDMn88ZVffUq0eH8uH9O8WxWQ1KZZWdMgJGWYYzh5YPKni9kc3X2Dk4paj7gswM9WqPP7MmDZvOIaandl25xegYpUIw7B/LTYYu17PYb5zvzrX1S+3wai7WQeIFH0wF2/Em9A5rtHYlLS3EkP3UBpq0fw0q8Te1DFum+dt3qWEQtnzgvFdCEupRTvCWygCdHRTrMXl1xocDeDJCxB8Ss2HqzlxSA+2Zx6fRHQVKcKrgRfI7B4qOz6P3fAoav1IpXeHcaSCFRsAiok7GWUSdD7Bqsy+0d5NconQG4Ga3l+o/8zCOoTd2tOXckKQgeW3SVLAH2C+Kw==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778242581; cv=none;\n b=OxKKBC511uCpn/iaal5z2HxU+dmLaLGxkubgceHixyEEbzXoob4AC5xPYrFsWN2A9PvnhmDKnJis3q9IPODgg/HG6QdkRFbKSiujMjOemeEOdqdxt8xzJF0cVUDkhhGw3Dskv4/kwEYV/CmFJuygXx/2i279LkksN9VoyWwnCPs=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1778242967; c=relaxed/relaxed;\n\tbh=jzJIYLNOQ5UlZMTTubAeA23KJPWfOAbaezYvUFo6acU=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Vtc4PBc6aImJ4OcX3/BQQcXgW01bd+OhedP+XHtjHM+27paObt4tAn8LO/h0DJaYHCeA74MI2ZsPHhKrZBLrORrVWRWSD4Rr8Qx8JSiXbONuAq3Q3t7U1N1/Utw4lMgCOaqrl+74pt+y+l0is8hQTwkjCMu3pYl2FOGb/ZLS2S35LgRd19ULEL2Y897XRSCf53gulDWgkfWZfuIt6BaaNiWkwIk0jIlJby5mpT/RBECSrPYXZ4hrEnZlg4/qj7sfXWKMRB19Ff0cLCTIVb2DgbCToxvNUYVTmxIao4OWvAxVjum+n/3luuno2pJ8+Ki0PE3F+hUhHJg6pvEaEn3p8A==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778242581; c=relaxed/simple;\n\tbh=OUftgixMNWlG++qrrDs5ZeGmxtXp1jfQD5mN2C6rp6E=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Q5E+YwD1Sulilr9UsZ1mOyDvoUSIl/898ycOwhosz3AvE1og9bRR5K+ttB01MuNfyx+JnONkXRQV57bMaLOUMsz6HthvV2qVh+L+Qa2ILLPPGi2HEpub5mSxAq2L+GnXcBeaomPRe5xghPqXrvnmiZkvW3TIjKl3pU5GD+HW2qk=" ], "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=Aw4Wh/zW; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16379-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=Aw4Wh/zW;\n arc=none smtp.client-ip=115.124.30.98" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linux.alibaba.com; s=default;\n\tt=1778242573; h=From:To:Subject:Date:Message-ID:MIME-Version;\n\tbh=jzJIYLNOQ5UlZMTTubAeA23KJPWfOAbaezYvUFo6acU=;\n\tb=Aw4Wh/zW++Mqs2Wb1rzSIOQ0VmRSdME6eTelCkYCpdGLzbtQZC79JOJGXAxQ4n9PF72S9ERWB4ODpqKalZhqaRW7VCSyeYVL+xaKnNApOgElNu21GXzq79U/CbY2FyB9wx2w5d8gaWyR4DdJuYO3j8MM1NkT6kw+wMBzewOcL/g=", "X-Alimail-AntiSpam": "\n AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=libaokun@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0X2XQgru_1778242572;", "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 17/17] ext4: add ext4_get_flex_group() helper to simplify\n flex group lookups", "Date": "Fri, 8 May 2026 20:15:39 +0800", "Message-ID": "<20260508121539.4174601-18-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": "Introduce ext4_get_flex_group() that combines ext4_flex_group() and\nsbi_array_rcu_deref() into a single call, replacing the repeated\npattern across ialloc.c, mballoc.c, resize.c, and super.c.\n\nNo functional change.\n\nSigned-off-by: Baokun Li <libaokun@linux.alibaba.com>\n---\n fs/ext4/ext4.h | 7 +++++++\n fs/ext4/ialloc.c | 19 +++++--------------\n fs/ext4/mballoc.c | 4 +---\n fs/ext4/resize.c | 4 +---\n fs/ext4/super.c | 4 +---\n 5 files changed, 15 insertions(+), 23 deletions(-)", "diff": "diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex f48cb9d998ab..e38ada51972a 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -3457,6 +3457,13 @@ static inline unsigned int ext4_flex_bg_size(struct ext4_sb_info *sbi)\n \treturn 1 << sbi->s_log_groups_per_flex;\n }\n \n+static inline struct flex_groups *ext4_get_flex_group(struct ext4_sb_info *sbi,\n+\t\t\t\t\t\t ext4_group_t block_group)\n+{\n+\treturn sbi_array_rcu_deref(sbi, s_flex_groups,\n+\t\t\t\t ext4_flex_group(sbi, block_group));\n+}\n+\n static inline loff_t ext4_get_maxbytes(struct inode *inode)\n {\n \tif (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))\ndiff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c\nindex 25430c572818..d88160afd6b6 100644\n--- a/fs/ext4/ialloc.c\n+++ b/fs/ext4/ialloc.c\n@@ -336,8 +336,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)\n \tif (sbi->s_log_groups_per_flex) {\n \t\tstruct flex_groups *fg;\n \n-\t\tfg = sbi_array_rcu_deref(sbi, s_flex_groups,\n-\t\t\t\t\t ext4_flex_group(sbi, block_group));\n+\t\tfg = ext4_get_flex_group(sbi, block_group);\n \t\tatomic_inc(&fg->free_inodes);\n \t\tif (is_directory)\n \t\t\tatomic_dec(&fg->used_dirs);\n@@ -826,12 +825,8 @@ static void ext4_update_inode_group_desc(struct super_block *sb,\n \text4_free_inodes_set(sb, gdp, ext4_free_inodes_count(sb, gdp) - 1);\n \tif (S_ISDIR(mode)) {\n \t\text4_used_dirs_set(sb, gdp, ext4_used_dirs_count(sb, gdp) + 1);\n-\t\tif (sbi->s_log_groups_per_flex) {\n-\t\t\text4_group_t f = ext4_flex_group(sbi, group);\n-\n-\t\t\tatomic_inc(&sbi_array_rcu_deref(sbi, s_flex_groups,\n-\t\t\t\t\t\t\tf)->used_dirs);\n-\t\t}\n+\t\tif (sbi->s_log_groups_per_flex)\n+\t\t\tatomic_inc(&ext4_get_flex_group(sbi, group)->used_dirs);\n \t}\n \n \tif (!ext4_has_group_desc_csum(sb))\n@@ -997,7 +992,6 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,\n \tint ret2, err;\n \tstruct inode *ret;\n \text4_group_t i;\n-\text4_group_t flex_group;\n \tstruct ext4_group_info *grp = NULL;\n \tbool encrypt = false;\n \n@@ -1220,11 +1214,8 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,\n \tif (S_ISDIR(mode))\n \t\tpercpu_counter_inc(&sbi->s_dirs_counter);\n \n-\tif (sbi->s_log_groups_per_flex) {\n-\t\tflex_group = ext4_flex_group(sbi, group);\n-\t\tatomic_dec(&sbi_array_rcu_deref(sbi, s_flex_groups,\n-\t\t\t\t\t\tflex_group)->free_inodes);\n-\t}\n+\tif (sbi->s_log_groups_per_flex)\n+\t\tatomic_dec(&ext4_get_flex_group(sbi, group)->free_inodes);\n \n \t/* the inode bitmap is zero-based */\n \tinode->i_ino = bit + 1 + group * EXT4_INODES_PER_GROUP(sb);\ndiff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c\nindex 77f6309916d1..9e30c9eefd35 100644\n--- a/fs/ext4/mballoc.c\n+++ b/fs/ext4/mballoc.c\n@@ -4181,9 +4181,7 @@ ext4_mb_mark_context(handle_t *handle, struct super_block *sb, bool state,\n \t\t*ret_changed = changed;\n \n \tif (sbi->s_log_groups_per_flex) {\n-\t\text4_group_t flex_group = ext4_flex_group(sbi, group);\n-\t\tstruct flex_groups *fg = sbi_array_rcu_deref(sbi,\n-\t\t\t\t\t s_flex_groups, flex_group);\n+\t\tstruct flex_groups *fg = ext4_get_flex_group(sbi, group);\n \n \t\tif (state)\n \t\t\tatomic64_sub(changed, &fg->free_clusters);\ndiff --git a/fs/ext4/resize.c b/fs/ext4/resize.c\nindex 2c5b851c552a..8d2cd1bc17bb 100644\n--- a/fs/ext4/resize.c\n+++ b/fs/ext4/resize.c\n@@ -1495,11 +1495,9 @@ static void ext4_update_super(struct super_block *sb,\n \text4_debug(\"free blocks count %llu\",\n \t\t percpu_counter_read(&sbi->s_freeclusters_counter));\n \tif (ext4_has_feature_flex_bg(sb) && sbi->s_log_groups_per_flex) {\n-\t\text4_group_t flex_group;\n \t\tstruct flex_groups *fg;\n \n-\t\tflex_group = ext4_flex_group(sbi, group_data[0].group);\n-\t\tfg = sbi_array_rcu_deref(sbi, s_flex_groups, flex_group);\n+\t\tfg = ext4_get_flex_group(sbi, group_data[0].group);\n \t\tatomic64_add(EXT4_NUM_B2C(sbi, free_blocks),\n \t\t\t &fg->free_clusters);\n \t\tatomic_add(EXT4_INODES_PER_GROUP(sb) * flex_gd->count,\ndiff --git a/fs/ext4/super.c b/fs/ext4/super.c\nindex 6a77db4d3124..064e06163716 100644\n--- a/fs/ext4/super.c\n+++ b/fs/ext4/super.c\n@@ -3211,7 +3211,6 @@ static int ext4_fill_flex_info(struct super_block *sb)\n \tstruct ext4_sb_info *sbi = EXT4_SB(sb);\n \tstruct ext4_group_desc *gdp = NULL;\n \tstruct flex_groups *fg;\n-\text4_group_t flex_group;\n \tint i, err;\n \n \tsbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex;\n@@ -3227,8 +3226,7 @@ static int ext4_fill_flex_info(struct super_block *sb)\n \tfor (i = 0; i < sbi->s_groups_count; i++) {\n \t\tgdp = ext4_get_group_desc(sb, i, NULL);\n \n-\t\tflex_group = ext4_flex_group(sbi, i);\n-\t\tfg = sbi_array_rcu_deref(sbi, s_flex_groups, flex_group);\n+\t\tfg = ext4_get_flex_group(sbi, i);\n \t\tatomic_add(ext4_free_inodes_count(sb, gdp), &fg->free_inodes);\n \t\tatomic64_add(ext4_free_group_clusters(sb, gdp),\n \t\t\t &fg->free_clusters);\n", "prefixes": [ "RFC", "17/17" ] }