{"id":2226012,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2226012/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260422021042.4157510-6-yi.zhang@huaweicloud.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":"<20260422021042.4157510-6-yi.zhang@huaweicloud.com>","list_archive_url":null,"date":"2026-04-22T02:10:25","name":"[v3,05/22] ext4: implement buffered read path using iomap","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5461a87e95437655f5451a08b0e12906ca9bcff0","submitter":{"id":85428,"url":"http://patchwork.ozlabs.org/api/1.2/people/85428/?format=json","name":"Zhang Yi","email":"yi.zhang@huaweicloud.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260422021042.4157510-6-yi.zhang@huaweicloud.com/mbox/","series":[{"id":500911,"url":"http://patchwork.ozlabs.org/api/1.2/series/500911/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=500911","date":"2026-04-22T02:10:23","name":"ext4: use iomap for regular file's buffered I/O path","version":3,"mbox":"http://patchwork.ozlabs.org/series/500911/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226012/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226012/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <SRS0=xZy/=CV=vger.kernel.org=linux-ext4+bounces-15972-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 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=xzy/=cv=vger.kernel.org=linux-ext4+bounces-15972-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=none (p=none dis=none) header.from=huaweicloud.com","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-15972-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=45.249.212.56","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=huaweicloud.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 4g0jdb34Gyz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 12:21:23 +1000 (AEST)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g0jdb2f0Zz4w1l\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 12:21:23 +1000 (AEST)","by gandalf.ozlabs.org (Postfix)\n\tid 4g0jdb2ZD1z4wK3; Wed, 22 Apr 2026 12:21:23 +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 4g0jdX00G7z4w1l\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 22 Apr 2026 12: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 AB29430807A2\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 22 Apr 2026 02:17:19 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 07A27346AF8;\n\tWed, 22 Apr 2026 02:17:03 +0000 (UTC)","from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com\n [45.249.212.56])\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 E3C3B3128B2;\n\tWed, 22 Apr 2026 02:17:00 +0000 (UTC)","from mail.maildlp.com (unknown [172.19.163.170])\n\tby dggsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4g0jX40CmhzKHMPM;\n\tWed, 22 Apr 2026 10:16:36 +0800 (CST)","from mail02.huawei.com (unknown [10.116.40.252])\n\tby mail.maildlp.com (Postfix) with ESMTP id 144AA405D4;\n\tWed, 22 Apr 2026 10:16:56 +0800 (CST)","from huaweicloud.com (unknown [10.50.85.155])\n\tby APP3 (Coremail) with SMTP id _Ch0CgB3JL6PL+hpqkgUBQ--.2635S9;\n\tWed, 22 Apr 2026 10:16:55 +0800 (CST)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1776824483; cv=pass;\n\tb=bSJ0pXiL6DnceWJCAIhlnR3tPOawF3GVkhOE6N8zvMHcd6On8LEuZM3ZyjoXoVm1PjKvQUb2O/t8yYX7c+7VS2Hg5HFnHEhcxk4wqnFHlkEHxtZZarbQlTFTgVfcYexaGCH8BRuJiMTV+cjSlsQM0SL8cCvAtxRO66/5/GqAd9Q5sxsIeCAbCvDmI9gqjcAzb5OQZ6A2YsmJaQMnc1TZ1gJhMyi75bplpFBPpJeKpeyFQmi/roXfPJ7AUIsjveVdv+oxiVs4xg4vvHPpzXJw5Vx8DlEAQhBgUbD4Fc88iSNT5IZAn5/xGpnwxXyUn/kg/6kHdkVhL3vj3zhQVHrHCg==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776824222; cv=none;\n b=kf7Q8Muv4nxlqMdiIlGZfBgBaA2Bju2TRLQUC8RRde/LBb5Dn5ukjJ3rv4Md813AW9wrhuE7waZIUHmrLB9bBZ0jf8s4ldGFnaVyQ6EAvuDzTgxVUS7lS8w/7+aKWGpVtSZhsGHqDFyaCWMq3S8ELjpv9IW+FnGL3n+xspldh3E="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1776824483; c=relaxed/relaxed;\n\tbh=+g+B8EUf5a9S4srSwGHIFpvaqGAl8DPBZoRYT2E1riI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=hf+TyrZAY3a7hs81u2gBeLUkNeUPhYhtYfbhF6ZmJs/XfPZfI3/w8HCsYPe4ORKJAPldE5xSZhIO5G7jPfextckPAzDiqYkW/HIhSsiSqLg09x0VW6SDqwQMlJKiIStkg1zE5tzg+M17PNh7DUCPFniubuERdNz8TfPiBDrAxR7QhwOHLZ24bZZkozU1uWAzq49MVokYQLR8T3tzozJPBe5w1ukBrqEvn4INtLNIflCwxUZcNWBnCCBJCte2pBPfwhPN/vuSZ3j1t66hn7FauSOd6dNzegWh9u2zGyvnnOzIJUUiCLZQmxBV/0W1SbsXa59Fi62UwVd0hCYaWSL7hg==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776824222; c=relaxed/simple;\n\tbh=AxOhwkfgQS+PDWAJdieVpQIzyuhddjFIhmvSBwoE34k=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Fxl5HUM890duuOJG+w7RM1KjkfzyBIRBk0Wa+kEASeVgUmfRGOYHlLzyAX1/wj1PxfTKGyek+v9efeFOSt+zghUsHNWMgKJpESnrL8vrhIrNJRrmnj/stHrN0ZzzLdQHMifcJuN5F0WsEVQD+HNl6+VutZBXSMkLFposcWRHLLU="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15972-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56"],"From":"Zhang Yi <yi.zhang@huaweicloud.com>","To":"linux-ext4@vger.kernel.org,\n\tlinux-fsdevel@vger.kernel.org","Cc":"linux-kernel@vger.kernel.org,\n\ttytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tlibaokun@linux.alibaba.com,\n\tjack@suse.cz,\n\tojaswin@linux.ibm.com,\n\tritesh.list@gmail.com,\n\tdjwong@kernel.org,\n\thch@infradead.org,\n\tyi.zhang@huawei.com,\n\tyi.zhang@huaweicloud.com,\n\tyizhang089@gmail.com,\n\tyangerkun@huawei.com,\n\tyukuai@fnnas.com","Subject":"[PATCH v3 05/22] ext4: implement buffered read path using iomap","Date":"Wed, 22 Apr 2026 10:10:25 +0800","Message-ID":"<20260422021042.4157510-6-yi.zhang@huaweicloud.com>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260422021042.4157510-1-yi.zhang@huaweicloud.com>","References":"<20260422021042.4157510-1-yi.zhang@huaweicloud.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-CM-TRANSID":"_Ch0CgB3JL6PL+hpqkgUBQ--.2635S9","X-Coremail-Antispam":"1UD129KBjvJXoWxGrW3tr4DXry8JFWktr1DJrb_yoW5Xr47pF\n\t90kFy5Gr4UWrnF9F4SqFZrXr1Ykan7Ja1UWryfGwnxWF90krW2gayjgF1YvF15tw47Ar40\n\tqF4jkry8Wr1UArDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUma14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI\n\tkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2\n\tz4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F\n\t4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq\n\t3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7\n\tIYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U\n\tM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2\n\tkIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkE\n\tbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67\n\tAF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI\n\t42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCw\n\tCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsG\n\tvfC2KfnxnUUI43ZEXa7VU1zpBDUUUUU==","X-CM-SenderInfo":"d1lo6xhdqjqx5xdzvxpfor3voofrz/","X-Spam-Status":"No, score=-1.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"From: Zhang Yi <yi.zhang@huawei.com>\n\nImplement the iomap read path for ext4 by introducing a new\next4_iomap_buffered_read_ops instance. This provides the read_folio()\nand readahead() callbacks for ext4_iomap_aops. The implementation\nintroduces:\n\n - ext4_iomap_map_blocks(): Helper function to query extent mappings for\n   a given read range using ext4_map_blocks() and convert the mapping\n   information to iomap type\n - ext4_iomap_buffered_read_begin(): The iomap_begin callback that maps\n   blocks, validates filesystem state, and populates the iomap. It\n   returns -ERANGE for inline data which is not yet supported.\n\nSigned-off-by: Zhang Yi <yi.zhang@huawei.com>\n---\n fs/ext4/inode.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 44 insertions(+), 1 deletion(-)","diff":"diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex 9e9f421888ed..df21f6870ec4 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -3908,14 +3908,57 @@ const struct iomap_ops ext4_iomap_report_ops = {\n \t.iomap_begin = ext4_iomap_begin_report,\n };\n \n+static int ext4_iomap_map_blocks(struct inode *inode, loff_t offset,\n+\t\tloff_t length, struct ext4_map_blocks *map)\n+{\n+\tu8 blkbits = inode->i_blkbits;\n+\n+\tif ((offset >> blkbits) > EXT4_MAX_LOGICAL_BLOCK)\n+\t\treturn -EINVAL;\n+\n+\t/* Calculate the first and last logical blocks respectively. */\n+\tmap->m_lblk = offset >> blkbits;\n+\tmap->m_len = min_t(loff_t, (offset + length - 1) >> blkbits,\n+\t\t\t   EXT4_MAX_LOGICAL_BLOCK) - map->m_lblk + 1;\n+\n+\treturn ext4_map_blocks(NULL, inode, map, 0);\n+}\n+\n+static int ext4_iomap_buffered_read_begin(struct inode *inode, loff_t offset,\n+\t\tloff_t length, unsigned int flags, struct iomap *iomap,\n+\t\tstruct iomap *srcmap)\n+{\n+\tstruct ext4_map_blocks map;\n+\tint ret;\n+\n+\tif (unlikely(ext4_forced_shutdown(inode->i_sb)))\n+\t\treturn -EIO;\n+\n+\t/* Inline data support is not yet available. */\n+\tif (WARN_ON_ONCE(ext4_has_inline_data(inode)))\n+\t\treturn -ERANGE;\n+\n+\tret = ext4_iomap_map_blocks(inode, offset, length, &map);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\text4_set_iomap(inode, iomap, &map, offset, length, flags);\n+\treturn 0;\n+}\n+\n+const struct iomap_ops ext4_iomap_buffered_read_ops = {\n+\t.iomap_begin = ext4_iomap_buffered_read_begin,\n+};\n+\n static int ext4_iomap_read_folio(struct file *file, struct folio *folio)\n {\n+\tiomap_bio_read_folio(folio, &ext4_iomap_buffered_read_ops);\n \treturn 0;\n }\n \n static void ext4_iomap_readahead(struct readahead_control *rac)\n {\n-\n+\tiomap_bio_readahead(rac, &ext4_iomap_buffered_read_ops);\n }\n \n static int ext4_iomap_writepages(struct address_space *mapping,\n","prefixes":["v3","05/22"]}