linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iomap: simplify iomap_readpage_actor
@ 2021-07-20  8:43 Christoph Hellwig
  2021-07-20  8:43 ` [PATCH 2/2] iomap: simplify iomap_add_to_ioend Christoph Hellwig
  2021-07-20 12:27 ` [PATCH 1/2] iomap: simplify iomap_readpage_actor Matthew Wilcox
  0 siblings, 2 replies; 9+ messages in thread
From: Christoph Hellwig @ 2021-07-20  8:43 UTC (permalink / raw)
  To: linux-xfs; +Cc: linux-fsdevel, willy

Now that the outstanding reads are counted in bytes, there is no need
to use the low-level __bio_try_merge_page API, we can switch back to
always using bio_add_page and simply iomap_readpage_actor again.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/iomap/buffered-io.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 87ccb3438becd9..4eaadbd265fcfa 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -241,7 +241,6 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
 	struct iomap_readpage_ctx *ctx = data;
 	struct page *page = ctx->cur_page;
 	struct iomap_page *iop;
-	bool same_page = false, is_contig = false;
 	loff_t orig_pos = pos;
 	unsigned poff, plen;
 	sector_t sector;
@@ -268,16 +267,10 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
 	if (iop)
 		atomic_add(plen, &iop->read_bytes_pending);
 
-	/* Try to merge into a previous segment if we can */
 	sector = iomap_sector(iomap, pos);
-	if (ctx->bio && bio_end_sector(ctx->bio) == sector) {
-		if (__bio_try_merge_page(ctx->bio, page, plen, poff,
-				&same_page))
-			goto done;
-		is_contig = true;
-	}
-
-	if (!is_contig || bio_full(ctx->bio, plen)) {
+	if (!ctx->bio ||
+	    bio_full(ctx->bio, plen) ||
+	    bio_end_sector(ctx->bio) != sector) {
 		gfp_t gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL);
 		gfp_t orig_gfp = gfp;
 		unsigned int nr_vecs = DIV_ROUND_UP(length, PAGE_SIZE);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* cleanup the bio handling in iomap v2
@ 2021-07-22  5:42 Christoph Hellwig
  2021-07-22  5:42 ` [PATCH 1/2] iomap: simplify iomap_readpage_actor Christoph Hellwig
  0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2021-07-22  5:42 UTC (permalink / raw)
  To: linux-xfs, linux-fsdevel; +Cc: Matthew Wilcox

Hi all,

this series cleans up the bio handling in the iomap buffered I/O code
by dropping use of the very lowlevel helpers.  We did only need them
before Matthew converted the inflight counters to be byte based

Changes sine v1:
 - fix readpage to properly handle bios that hit their byte size limit

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-22 19:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-20  8:43 [PATCH 1/2] iomap: simplify iomap_readpage_actor Christoph Hellwig
2021-07-20  8:43 ` [PATCH 2/2] iomap: simplify iomap_add_to_ioend Christoph Hellwig
2021-07-20 12:10   ` Matthew Wilcox
2021-07-20 12:16     ` Christoph Hellwig
2021-07-20 12:27 ` [PATCH 1/2] iomap: simplify iomap_readpage_actor Matthew Wilcox
2021-07-20 13:26   ` Christoph Hellwig
2021-07-20 13:41     ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2021-07-22  5:42 cleanup the bio handling in iomap v2 Christoph Hellwig
2021-07-22  5:42 ` [PATCH 1/2] iomap: simplify iomap_readpage_actor Christoph Hellwig
2021-07-22 19:34   ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).