summaryrefslogtreecommitdiffstats
path: root/fs/iomap.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-06-24 10:23:16 +0200
committerJoerg Roedel <jroedel@suse.de>2019-06-24 10:23:16 +0200
commitceedd5f74d8cfe34db4e654a7808e3c5de40d6f5 (patch)
treee19c18292231202e9cd8d484ee43f46b2c9c9ad1 /fs/iomap.c
parentiommu/dma: Fix condition check in iommu_dma_unmap_sg (diff)
parentLinux 5.2-rc6 (diff)
downloadlinux-ceedd5f74d8cfe34db4e654a7808e3c5de40d6f5.tar.xz
linux-ceedd5f74d8cfe34db4e654a7808e3c5de40d6f5.zip
Merge tag 'v5.2-rc6' into generic-dma-ops
Linux 5.2-rc6
Diffstat (limited to 'fs/iomap.c')
-rw-r--r--fs/iomap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/iomap.c b/fs/iomap.c
index 23ef63fd1669..12654c2e78f8 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -287,7 +287,7 @@ 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 = iomap_page_create(inode, page);
- bool is_contig = false;
+ bool same_page = false, is_contig = false;
loff_t orig_pos = pos;
unsigned poff, plen;
sector_t sector;
@@ -315,10 +315,14 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
* 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, true))
- goto done;
+ if (ctx->bio && bio_end_sector(ctx->bio) == sector)
is_contig = true;
+
+ if (is_contig &&
+ __bio_try_merge_page(ctx->bio, page, plen, poff, &same_page)) {
+ if (!same_page && iop)
+ atomic_inc(&iop->read_count);
+ goto done;
}
/*