Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.137.202.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796376657; b=xcBnobZrjVJ5x1YomZpqGPr9BA0/45ON+c1Ktr4q9IGy86LPYl+pf7cTowiQwm3DXGjL 6rwA7J59an6VeK3hsEHT9kCiXGjwJMe8w5Zdv7FcQQVqLh9zPYM4rk5VJHfH8iJZ1fBg0 lwHlOX87TyOEh1CWFariYuau/QKrT4pWLWkJhXvo4ne7xKz5l3WNc39zlldLzkt1aH8gv hBdKfUTHpkzFCMLEG6ylmG5sVqiSa4Xvg5p5UNJymeoVTzcgBkP8np5/fNQFzKJUHansV jFVJz14r7u5eqBAsxHAvebwPqPNm0mdbGCBRHtU/z6iV+TBTwDVz6bzyZ+0qr+XfOdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796376657; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-SRS-Rewrite; bh=Z386ELiG3nGGryrZy5lKeljdo76SVkFnRiPbbYoiuJs=; b=RRB8691g0PUV75jQGdb8iy4EBfeDszKh4JZt5gyrQQ0wTcdNEBdCiCTyg4BO9Q0gQ3Qn +gmVvZ8dZFmZKGLOa0V4epYGzvaqfEJ4ywWFqe1ZWbh8vDF8DQR8EwV7ToWfTd275KH5u 4cCDSi+dfTlgaQF8hUJJObhd3MflJnFGQ/2lMoTLavltWSax2RmtL7aiFJ0DbJapaVN2F z8lPq6PSv2wkYoqVU8vnBYW51mEfKtGL+Ow/AUnWbd/T2TeqtydlIoyZBna5xIvRbr01t f7B/2c3k45aeGrYTiNuYJsM0FQjKmUNFe93WehyWyh/5HvdKDk69Y9S/X41A/rO8TZQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b="d/E68f7+"; arc=none smtp.remote-ip=198.137.202.133 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9241606A322; Fri, 4 Dec 2026 09:30:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A9241606A322 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.a=rsa-sha256 header.s=bombadil.20210309 header.b=d/E68f7+ 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=Z386ELiG3nGGryrZy5lKeljdo76SVkFnRiPbbYoiuJs=; b=d/E68f7+kLQJXn8I09C9uePS25 lrtDh+tYlqbi0OwaLyGonnYrF6S2c4hJpRnAcWXTA99bgfKS+PT1mWd/iWuBkwp5iNuBgSVCWbNBI CT78J3fD9ymfThga+3P2djCBZNn9oFWieP+hbEVbm8+8GHa6kf2QGpWWaXCMNtDx4I6DIPHgIUYJW YlifHaZfkKKnKRC6saPv/nr+qm7kuXlUF+R040lZhFt6bB9MTLKDSVPNXp6igDHKlgw0hkF5em7DH uia8xyJTTj6r6eC24CNnvP8KIT041yQaz5JRH8wTwjkdw0T57UQ/fSxrs/BmqtaJnWKSvMUtHif3S NnTMPMLA==; Received: from 2a02-8389-2301-9f00-1d8d-b225-bb4b-bd8f.cable.dynamic.v6.surfer.at ([2a02:8389:2301:9f00:1d8d:b225:bb4b:bd8f] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZPd1-0000000HN0k-3nuK; Fri, 04 Dec 2026 09:30:56 +0000 From: Christoph Hellwig To: Christian Brauner Cc: Carlos Maiolino , Joanne Koong , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] iomap: factor out a iomap_read_submit helper Date: Fri, 4 Dec 2026 10:30:11 +0100 Message-ID: <20261204093048.2537479-2-hch@lst.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261204093048.2537479-1-hch@lst.de> References: <20261204093048.2537479-1-hch@lst.de> X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 Prepare for adding more submit code by de-duplicating the logic around the method call. Signed-off-by: Christoph Hellwig --- fs/iomap/bio.c | 3 +-- fs/iomap/buffered-io.c | 13 +++++++++---- fs/iomap/internal.h | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/fs/iomap/bio.c b/fs/iomap/bio.c index 256564ebe238..b91f3fa59d14 100644 --- a/fs/iomap/bio.c +++ b/fs/iomap/bio.c @@ -75,8 +75,7 @@ static void iomap_read_alloc_bio(const struct iomap_iter *iter, struct bio *bio; /* Submit the existing range if there was one. */ - if (ctx->read_ctx) - ctx->ops->submit_read(iter, ctx); + iomap_read_submit(iter, ctx); /* Same as readahead_gfp_mask: */ if (ctx->rac) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 25915c0f5e1c..59bff9f000a3 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -554,6 +554,13 @@ static void iomap_read_end(struct folio *folio, size_t bytes_submitted) } } +void iomap_read_submit(const struct iomap_iter *iter, + struct iomap_read_folio_ctx *ctx) +{ + if (ctx->read_ctx && ctx->ops->submit_read) + ctx->ops->submit_read(iter, ctx); +} + static int iomap_read_folio_iter(struct iomap_iter *iter, struct iomap_read_folio_ctx *ctx, size_t *bytes_submitted) { @@ -675,8 +682,7 @@ void iomap_read_folio(iomap_iter_next_fn next, struct iomap_read_folio_ctx *ctx, while ((ret = iomap_iter(&iter, next)) > 0) { iter.status = iomap_read_folio_iter(&iter, ctx, &bytes_submitted); - if (ctx->read_ctx && ctx->ops->submit_read) - ctx->ops->submit_read(&iter, ctx); + iomap_read_submit(&iter, ctx); } if (ctx->cur_folio) @@ -751,8 +757,7 @@ void iomap_readahead(iomap_iter_next_fn next, struct iomap_read_folio_ctx *ctx, while (iomap_iter(&iter, next) > 0) { iter.status = iomap_readahead_iter(&iter, ctx, &cur_bytes_submitted); - if (ctx->read_ctx && ctx->ops->submit_read) - ctx->ops->submit_read(&iter, ctx); + iomap_read_submit(&iter, ctx); } if (ctx->cur_folio) diff --git a/fs/iomap/internal.h b/fs/iomap/internal.h index e69b3ac02cc2..a194b7346184 100644 --- a/fs/iomap/internal.h +++ b/fs/iomap/internal.h @@ -29,6 +29,8 @@ static inline bool iomap_bio_has_room(const struct iomap *iomap, u32 iomap_finish_ioend_buffered_read(struct iomap_ioend *ioend); u32 iomap_finish_ioend_direct(struct iomap_ioend *ioend); +void iomap_read_submit(const struct iomap_iter *iter, + struct iomap_read_folio_ctx *ctx); #ifdef CONFIG_BLOCK int iomap_bio_read_folio_range_sync(const struct iomap_iter *iter, struct folio *folio, loff_t pos, size_t len); -- 2.53.0