[PATCH 33/40] iomap: add a hint to ->submit_io if there is more I/O coming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Btrfs would like to optimize checksum offloading to threads depending on
if there is more I/O to come.  Pass that information to the ->submit_io
method.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 fs/btrfs/inode.c      | 2 +-
 fs/iomap/direct-io.c  | 8 ++++----
 include/linux/iomap.h | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 70d82effe5e37..2eb7e730c2afc 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7917,7 +7917,7 @@ static struct btrfs_dio_private *btrfs_create_dio_private(struct bio *dio_bio,
 }
 
 static void btrfs_submit_direct(const struct iomap_iter *iter,
-		struct bio *dio_bio, loff_t file_offset)
+		struct bio *dio_bio, loff_t file_offset, bool more)
 {
 	struct inode *inode = iter->inode;
 	const bool write = (btrfs_op(dio_bio) == BTRFS_MAP_WRITE);
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 392ee8fe1f8c3..3f18b04d73cde 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -60,7 +60,7 @@ static struct bio *iomap_dio_alloc_bio(const struct iomap_iter *iter,
 }
 
 static void iomap_dio_submit_bio(const struct iomap_iter *iter,
-		struct iomap_dio *dio, struct bio *bio, loff_t pos)
+		struct iomap_dio *dio, struct bio *bio, loff_t pos, bool more)
 {
 	atomic_inc(&dio->ref);
 
@@ -70,7 +70,7 @@ static void iomap_dio_submit_bio(const struct iomap_iter *iter,
 	}
 
 	if (dio->dops && dio->dops->submit_io)
-		dio->dops->submit_io(iter, bio, pos);
+		dio->dops->submit_io(iter, bio, pos, more);
 	else
 		submit_bio(bio);
 }
@@ -200,7 +200,7 @@ static void iomap_dio_zero(const struct iomap_iter *iter, struct iomap_dio *dio,
 
 	get_page(page);
 	__bio_add_page(bio, page, len, 0);
-	iomap_dio_submit_bio(iter, dio, bio, pos);
+	iomap_dio_submit_bio(iter, dio, bio, pos, false);
 }
 
 /*
@@ -353,7 +353,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
 		 */
 		if (nr_pages)
 			dio->iocb->ki_flags &= ~IOCB_HIPRI;
-		iomap_dio_submit_bio(iter, dio, bio, pos);
+		iomap_dio_submit_bio(iter, dio, bio, pos, nr_pages);
 		pos += n;
 	} while (nr_pages);
 
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 5648753973de0..c4a2fa441e4f9 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -340,7 +340,7 @@ struct iomap_dio_ops {
 	int (*end_io)(struct kiocb *iocb, ssize_t size, int error,
 		      unsigned flags);
 	void (*submit_io)(const struct iomap_iter *iter, struct bio *bio,
-		          loff_t file_offset);
+		          loff_t file_offset, bool more);
 
 	struct bio_set *bio_set;
 };
-- 
2.30.2




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux