Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2627674rwb; Wed, 30 Nov 2022 08:52:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf6M6GwjorwKH335r00sbCeRgIayFvbpzKXlE+idH5Lhvmy5GwPQYdUxnIHZ/FtTS4GwiAIJ X-Received: by 2002:a17:902:b7c3:b0:189:5e92:d45a with SMTP id v3-20020a170902b7c300b001895e92d45amr30600112plz.157.1669827123147; Wed, 30 Nov 2022 08:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669827123; cv=none; d=google.com; s=arc-20160816; b=j5r9Umpi8+TI/cY56nDWustFsWPG1b+bKdUfGjzRhJOc9e7uBASeAP1Bc3Co7FdvcE sbSMLYOf3IAN/AT6xOKKJltW3dUEevK+o0oTJYRpkG0lcJUlM2quu7FY9Hvd2YVm4Btr m1KBxUH1o2BjTCX2+oY43uUK9o2085L1jxVWosYIuKOtC+9SAvFqnusDDzKKyTHuj0iH qmIzqd3dl/FjrPcjKs9T7wk4IacrwdAO1S21hvSOT6zDdG3BOgXaC5TUGjVNKm+9EobF J8B+/2KWVmEw1uftrI3AdJHKbGisMxBrUq3VkT7gu59HkwwK07nUqPNyVizJvtZCyFUS hbYQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=z441ZeCqEE0sfhCJc0co0PzncYIwOxI96zyBrV+QmUA=; b=UnTaFeo5X/uYBPAeT6rM6eNYa/9GBMZfHOKsBIttr+GQMGJaGZFEQRvrx8bs4qcdNO PEuNZmM79Lbp//89iH2nxsmathfWhF9eW9zguhaoYIm5v2ko2jskcYTQUskl8MwFcJzD 5bmDkZjFqH3kgtcQN+iRBcjIz8pFZ8z+LGhGO1hqJdOecPnyQ2K7LfJk+zkGME/sorjK v0do61lWOBZB8ifn3nym0FN2tOo6+eKolT6mAt+9bw3dWBkH7OMKnizOFFDtMsjI8JQu EFm7QTzyN/mKNmoLYYj4ZVL7EeskRbht34VapUlJ40pAiPAnP6OEVJxZ6XSbreMOMQrF jBXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WzzKU3EN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bp17-20020a17090b0c1100b0021949ab4eefsi4499159pjb.65.2022.11.30.08.51.49; Wed, 30 Nov 2022 08:52:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WzzKU3EN; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229733AbiK3QgQ (ORCPT + 99 others); Wed, 30 Nov 2022 11:36:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbiK3QgM (ORCPT ); Wed, 30 Nov 2022 11:36:12 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1886F86A36 for ; Wed, 30 Nov 2022 08:36:11 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C172421B12; Wed, 30 Nov 2022 16:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669826169; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z441ZeCqEE0sfhCJc0co0PzncYIwOxI96zyBrV+QmUA=; b=WzzKU3ENdzn5dLGDvZqQ42IvX0XYs4WZRcndcRgLC64k9sj76dcWVBWGydLrqt7kY7I09K ZKlwX6ZxcFbn3zFe8ETrTfToZ637yoC3lcNCKu11lUf1/iwyanV2A0TfxqFuxSyw0wy0qH NJkCKljD/xsTV9ADiLEmYuvZrPPCFm4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669826169; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z441ZeCqEE0sfhCJc0co0PzncYIwOxI96zyBrV+QmUA=; b=4NbsOXjpoyi+P17xgOEQQUaIdlzqyKmQI8oYVIPL+Ku/dJOnu0jPlTRQmALUDJost8xjXt 15rkGuqQ0CqXQlAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B2CD613B25; Wed, 30 Nov 2022 16:36:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id X9ylK3mGh2NiQgAAMHmgww (envelope-from ); Wed, 30 Nov 2022 16:36:09 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id D07B6A071D; Wed, 30 Nov 2022 17:36:08 +0100 (CET) From: Jan Kara To: Ted Tso Cc: , Christoph Hellwig , Jan Kara Subject: [PATCH 8/9] ext4: Switch to using ext4_do_writepages() for ordered data writeout Date: Wed, 30 Nov 2022 17:35:59 +0100 Message-Id: <20221130163608.29034-8-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221130162435.2324-1-jack@suse.cz> References: <20221130162435.2324-1-jack@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2219; i=jack@suse.cz; h=from:subject; bh=xrZV+XmyUTBNF6kIFVC6Dhs/s/T7qbfVszfA0d8XoOU=; b=owGbwMvMwME4Z+4qdvsUh5uMp9WSGJLb2/JTfPu2/2495yO+WrttUumXtbnsQqzzE2fdan68qaTv V01CJ6MxCwMjB4OsmCLL6siL2tfmGXVtDdWQgRnEygQyhYGLUwAm8kOe/Q/Pu5YL3y9JnA3TMj2Yl3 rhyHqJOL3vh8oPp87+fC1q5SI1iZoFZ+71nnojfafmYr2pS0dwgYd6Qwm/KveDLEu+hUFWp51zfyfF Khv2dOw/6mr/Winjs7u2w6Nt1YJJ8UbBL5SdGLPq+Va9yPt0dM8O2U/+zOYSHxTS10Tt2HLT871uoL jmSh3hnZJWSxdu31dkaL5a1D79l2+84+3fdvwr9DY7xc+Q5/3kZflpSVPC5Qi94q5PB7qbre+3vbpV cVGLYw3TA0/xaMXvp6f7deVa7/gzsfeNVpuOtHatQq4iG9uG5ueTPsq+0wxweyDvsL7nY/In7+MCqZ 3n89jrnWy3Ho6w6U/VEmILvJsBAA== X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use the standard writepages method (ext4_do_writepages()) to perform writeout of ordered data during journal commit. Signed-off-by: Jan Kara --- fs/ext4/ext4.h | 1 + fs/ext4/inode.c | 16 ++++++++++++++++ fs/ext4/super.c | 3 +-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 1b3bffc04fd0..07b55cc48578 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2999,6 +2999,7 @@ extern void ext4_set_inode_flags(struct inode *, bool init); extern int ext4_alloc_da_blocks(struct inode *inode); extern void ext4_set_aops(struct inode *inode); extern int ext4_writepage_trans_blocks(struct inode *); +extern int ext4_normal_submit_inode_data_buffers(struct jbd2_inode *jinode); extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks); extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode, loff_t lstart, loff_t lend); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 00c4d12f8270..c131b611dabf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2950,6 +2950,22 @@ static int ext4_writepages(struct address_space *mapping, return ret; } +int ext4_normal_submit_inode_data_buffers(struct jbd2_inode *jinode) +{ + struct writeback_control wbc = { + .sync_mode = WB_SYNC_ALL, + .nr_to_write = LONG_MAX, + .range_start = jinode->i_dirty_start, + .range_end = jinode->i_dirty_end, + }; + struct mpage_da_data mpd = { + .inode = jinode->i_vfs_inode, + .wbc = &wbc, + .can_map = 0, + }; + return ext4_do_writepages(&mpd); +} + static int ext4_dax_writepages(struct address_space *mapping, struct writeback_control *wbc) { diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7cdd2138c897..c02329dd7574 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -540,8 +540,7 @@ static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) if (ext4_should_journal_data(jinode->i_vfs_inode)) ret = ext4_journalled_submit_inode_data_buffers(jinode); else - ret = jbd2_journal_submit_inode_data_buffers(jinode); - + ret = ext4_normal_submit_inode_data_buffers(jinode); return ret; } -- 2.35.3