From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0896A3FB060; Mon, 2 Mar 2026 14:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772461169; cv=none; b=GdD73F/7sIx8qQ+kBDb32YFydUGNM2N3tW+k3GgqJCYCGqASGejiaR+1E/2vQ0kahHbSt0mSyfYoR1YmN+e+0fpNbNuoCR7dzT8stcXxtz15w1yrv48BpBR03byX/apm+mofaPdHKBSdq2tg+NJUQ9oiR37/cIHpCYxEMy2wux8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772461169; c=relaxed/simple; bh=VNePzfeVd8btvndt8gE5rlVw3FdQT6PAfCrUZmRmhOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mt3z8C431jIkoWqyzXbCrhaVaXx0EQL1PRQr+2fieGt80eBzkzdkrRhYBVRnt2aq5KeT/u+vcz3tLgf1C6B+2pq+bpCXwj1K/B+yHbEFOcicNu4afU7hBgBH1C22Vyw+RQI2DG/ag8nORwA3vkA5BRCTndfaQaD6/e8+pL0FEFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=TWuabgNQ; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TWuabgNQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=dyk1509rfcvr1/bUzEnCUHnbGvw79uAFdkbY5OpbSbc=; b=TWuabgNQod72mWav+2HeM7yr6b CcOnMnWbgXwPCiQ20aPDsL46Z+u5obJZ1kIMxJcrRpUY/VFtyj3WkJcngxlFYn66cHbqY6MdvNHnh Ty5rAiD9jZmMr7gsh7biJUDFKHZuUTeIN6+tRKSwY8act3tsPU/9kTWfCSBGWuX9vnhWW14UrayJx hjXTDqLORZvwD2TVe9FzerBcjeA9mwNVbkZ70GY5ZtJc/fJrmj7ZOCysD10ykjFSXxkXfe/eE/3Q6 QfMhvT11RegxHWOzUmkx6wuYapTsMjtaf1QYlORVRZwLCCFsd5/GS52IdzqCP/1LdkVCM/CKVx5Oj 7kPpnEZg==; Received: from [2604:3d08:797f:2840::9d5f] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vx47L-0000000DDRy-2fEm; Mon, 02 Mar 2026 14:19:27 +0000 From: Christoph Hellwig To: Eric Biggers Cc: "Theodore Y. Ts'o" , Jaegeuk Kim , Andreas Dilger , Chao Yu , Christian Brauner , "Darrick J. Wong" , linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH 03/14] ext4: factor out a io_submit_need_new_bio helper Date: Mon, 2 Mar 2026 06:18:08 -0800 Message-ID: <20260302141922.370070-4-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260302141922.370070-1-hch@lst.de> References: <20260302141922.370070-1-hch@lst.de> 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Factor out a helper to prepare for making this logic a bit more complex in the next commit. Signed-off-by: Christoph Hellwig --- fs/ext4/page-io.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index c5ca99b33c26..58cdbd836fd6 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -439,14 +439,23 @@ static void io_submit_init_bio(struct ext4_io_submit *io, wbc_init_bio(io->io_wbc, bio); } +static bool io_submit_need_new_bio(struct ext4_io_submit *io, + struct buffer_head *bh) +{ + if (bh->b_blocknr != io->io_next_block) + return true; + if (!fscrypt_mergeable_bio_bh(io->io_bio, bh)) + return true; + return false; +} + static void io_submit_add_bh(struct ext4_io_submit *io, struct inode *inode, struct folio *folio, struct folio *io_folio, struct buffer_head *bh) { - if (io->io_bio && (bh->b_blocknr != io->io_next_block || - !fscrypt_mergeable_bio_bh(io->io_bio, bh))) { + if (io->io_bio && io_submit_need_new_bio(io, bh)) { submit_and_retry: ext4_io_submit(io); } -- 2.47.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D3A8EA4E0B for ; Mon, 2 Mar 2026 14:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DHDtaYe4C18lAb7qKnhkFGUzSu3R4x1JKBN9KlGlypM=; b=SOWgn6v3A5mcHs5+QdCV3I/E4d XF9K+CNxtTzqc00GPPDgfOGKmDVpNDZdrM4FJBpD95/uGA7sbnLA9Lyg8yrOzkA5HEsqy47o81Adq osuyw6fimRg/Taiplr9jIXCPjIR8tidkqVjdQ++L4kAPxnl1hVbTU2KJKIqc03zuuifY=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vx47Y-0002Fl-RC; Mon, 02 Mar 2026 14:19:40 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vx47X-0002Ff-2D for linux-f2fs-devel@lists.sourceforge.net; Mon, 02 Mar 2026 14:19:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dyk1509rfcvr1/bUzEnCUHnbGvw79uAFdkbY5OpbSbc=; b=O198JM5jK3HC3iA9jGBQ4SGm84 4ZKbf+A2wcjuEe7z8T2mcX4ts0pn9Yl139GGr+kjfWYb+knL2kRIeKCBVELP3nr2/kGV4Hk7AN4ZL EoP9EFWqjjyAqt5xc61N9kaRoEyYXVj0M6WPzbkO2mzEbnUqMlAkF+JXrepJgzOykgdk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dyk1509rfcvr1/bUzEnCUHnbGvw79uAFdkbY5OpbSbc=; b=AsXqHnwDDXtM555NQhPjwb/3We Uvxp4jjWu83XVUrrP8XB9QnlrqjjmjJNVb0upwl8kqzXjStXj4TXmGzKwugUfHZuzO0LH5Jd0XOkS sWkkYRr+luHhTzLsggmfCtbulCpkShmi6fVnbZguLD49/AdXodgXunjKaArabeij07b8=; Received: from bombadil.infradead.org ([198.137.202.133]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vx47W-0001Tc-L4 for linux-f2fs-devel@lists.sourceforge.net; Mon, 02 Mar 2026 14:19:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=dyk1509rfcvr1/bUzEnCUHnbGvw79uAFdkbY5OpbSbc=; b=TWuabgNQod72mWav+2HeM7yr6b CcOnMnWbgXwPCiQ20aPDsL46Z+u5obJZ1kIMxJcrRpUY/VFtyj3WkJcngxlFYn66cHbqY6MdvNHnh Ty5rAiD9jZmMr7gsh7biJUDFKHZuUTeIN6+tRKSwY8act3tsPU/9kTWfCSBGWuX9vnhWW14UrayJx hjXTDqLORZvwD2TVe9FzerBcjeA9mwNVbkZ70GY5ZtJc/fJrmj7ZOCysD10ykjFSXxkXfe/eE/3Q6 QfMhvT11RegxHWOzUmkx6wuYapTsMjtaf1QYlORVRZwLCCFsd5/GS52IdzqCP/1LdkVCM/CKVx5Oj 7kPpnEZg==; Received: from [2604:3d08:797f:2840::9d5f] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vx47L-0000000DDRy-2fEm; Mon, 02 Mar 2026 14:19:27 +0000 From: Christoph Hellwig To: Eric Biggers Date: Mon, 2 Mar 2026 06:18:08 -0800 Message-ID: <20260302141922.370070-4-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260302141922.370070-1-hch@lst.de> References: <20260302141922.370070-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Headers-End: 1vx47W-0001Tc-L4 Subject: [f2fs-dev] [PATCH 03/14] ext4: factor out a io_submit_need_new_bio helper X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Brauner , "Theodore Y. Ts'o" , "Darrick J. Wong" , linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Andreas Dilger , linux-fsdevel@vger.kernel.org, Jaegeuk Kim , linux-ext4@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Factor out a helper to prepare for making this logic a bit more complex in the next commit. Signed-off-by: Christoph Hellwig --- fs/ext4/page-io.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index c5ca99b33c26..58cdbd836fd6 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -439,14 +439,23 @@ static void io_submit_init_bio(struct ext4_io_submit *io, wbc_init_bio(io->io_wbc, bio); } +static bool io_submit_need_new_bio(struct ext4_io_submit *io, + struct buffer_head *bh) +{ + if (bh->b_blocknr != io->io_next_block) + return true; + if (!fscrypt_mergeable_bio_bh(io->io_bio, bh)) + return true; + return false; +} + static void io_submit_add_bh(struct ext4_io_submit *io, struct inode *inode, struct folio *folio, struct folio *io_folio, struct buffer_head *bh) { - if (io->io_bio && (bh->b_blocknr != io->io_next_block || - !fscrypt_mergeable_bio_bh(io->io_bio, bh))) { + if (io->io_bio && io_submit_need_new_bio(io, bh)) { submit_and_retry: ext4_io_submit(io); } -- 2.47.3 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel