Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp310689rdh; Thu, 23 Nov 2023 04:52:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeORWVJlQEuZ/2wjZyg9tV0k4BDzGmotzUn9IEu11cNVwFKZ9fa0bR7YEmGwzIR9eIpDou X-Received: by 2002:a05:620a:51d3:b0:77d:645a:85e7 with SMTP id cx19-20020a05620a51d300b0077d645a85e7mr5450054qkb.42.1700743963897; Thu, 23 Nov 2023 04:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700743963; cv=none; d=google.com; s=arc-20160816; b=T+NSR10OHV4bJV/LyZmhjg81oWEo9NFY14wnCkg5Z6DAWOgiUbWZ/V6kZJwQaT2ArD oOq7IufX85YiLf4O23LGR2qrwuMWrZtasQZjoJuelW7eqf6L/x0Vxq7brTlS5FoN75Vq 3s7sngo5Z2XNdKYbS+XHpyL5RR1BEbDJCFOEQHrGeqb56Mvt2H2JMddmsCDhvQ5QmDOs M1zLXIwdgTDvc6ouCvFSNms7jnnOu2xPswZ/RCUWWYa5ERpJsZRNR0Pd5WZozYVFSd5/ svpX1ca8lD8v7rUEl2PN6iO0b9OYL1ShXCKjSJbMsYV6+M3rsho5N1LYj8YFFNIdDIg/ /8hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=MBA3MW62OiP9Z8fDboeZQovnSialVQgCh8PsdXHr9/s=; fh=oXgJbFeK1mY0T4jBbK/Fs3Mi9F4SdMRqpoziDljuAF4=; b=pgbo/0dTYGIsNIMtdyibkxncmdp+0eY3ftGqV99Hvdddq9QQH+st2zPgQDxHrZH2cX DNIpIhQv+d0tGmuSfm2I53VpOWDo7rxet1ro0QoBLSpN8riRI8MaIx5Un83nR14+nXlD dShK28eoryCv2pf/kf/l06quXj9kYoTItCAjD73phskrjHQvcdjuv5XcwnZrNhS+0NxH B1Do+0JU8vrDM8906g1MkppD9Iz1nVSOCrQd+4GRUZ2aJA4dDJ/W8cJ6+2al5xCVjJ4j c2xFh37oltX+WGWE5SGMHG10ANm5OJLoxn7A4e27Uz4CU3cFZrE2jTS+BV+K9y/yQI/y KM1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-112-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c12-20020a37e10c000000b0077d78a2fbfbsi278198qkm.597.2023.11.23.04.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 04:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4+bounces-112-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-112-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A3D101C20FD2 for ; Thu, 23 Nov 2023 12:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82FE52557C; Thu, 23 Nov 2023 12:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none X-Original-To: linux-ext4@vger.kernel.org Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66D0591; Thu, 23 Nov 2023 04:52:05 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4SbdKs0cl2z4f3kFB; Thu, 23 Nov 2023 20:52:01 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id C06801A06D2; Thu, 23 Nov 2023 20:52:02 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgDn6xHdSl9lSfnfBg--.20473S12; Thu, 23 Nov 2023 20:52:02 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, ritesh.list@gmail.com, hch@infradead.org, djwong@kernel.org, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [RFC PATCH 08/18] ext4: add a new iomap aops for regular file's buffered IO path Date: Thu, 23 Nov 2023 20:51:10 +0800 Message-Id: <20231123125121.4064694-9-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231123125121.4064694-1-yi.zhang@huaweicloud.com> References: <20231123125121.4064694-1-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgDn6xHdSl9lSfnfBg--.20473S12 X-Coremail-Antispam: 1UD129KBjvJXoW7WFW8WrW8ZFW8JF17KrWrGrg_yoW8Zw45pF 90kas5Gr1xArnruan3XF9rAFWa934fJF4jqFW3Wa4avr15C3y7Gayj9a4YkF45J3ykJryr Xr4jkryxW3WUArDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPI14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2 kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr 0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUQ SdkUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ From: Zhang Yi Introduce a new iomap address space operations ext4_iomap_aops that used to support regular file's buffered IO path. Most of their callbacks have already been implemented yet, the .read_folio, .readahead and .writepages should be implemented later. Signed-off-by: Zhang Yi --- fs/ext4/inode.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index e92b205b3b24..4eef3828d5fd 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3525,6 +3525,22 @@ const struct iomap_ops ext4_iomap_report_ops = { .iomap_begin = ext4_iomap_begin_report, }; +static int ext4_iomap_read_folio(struct file *file, struct folio *folio) +{ + return 0; +} + +static void ext4_iomap_readahead(struct readahead_control *rac) +{ + +} + +static int ext4_iomap_writepages(struct address_space *mapping, + struct writeback_control *wbc) +{ + return 0; +} + /* * For data=journal mode, folio should be marked dirty only when it was * writeably mapped. When that happens, it was already attached to the @@ -3614,6 +3630,21 @@ static const struct address_space_operations ext4_da_aops = { .swap_activate = ext4_iomap_swap_activate, }; +static const struct address_space_operations ext4_iomap_aops = { + .read_folio = ext4_iomap_read_folio, + .readahead = ext4_iomap_readahead, + .writepages = ext4_iomap_writepages, + .dirty_folio = iomap_dirty_folio, + .bmap = ext4_bmap, + .invalidate_folio = iomap_invalidate_folio, + .release_folio = iomap_release_folio, + .direct_IO = noop_direct_IO, + .migrate_folio = filemap_migrate_folio, + .is_partially_uptodate = iomap_is_partially_uptodate, + .error_remove_page = generic_error_remove_page, + .swap_activate = ext4_iomap_swap_activate, +}; + static const struct address_space_operations ext4_dax_aops = { .writepages = ext4_dax_writepages, .direct_IO = noop_direct_IO, -- 2.39.2