summaryrefslogtreecommitdiffstats
path: root/include/linux/iomap.h
diff options
context:
space:
mode:
authorDarrick J. Wong2019-07-15 17:50:59 +0200
committerDarrick J. Wong2019-07-17 16:16:00 +0200
commitdb074436f421967f4f30cfbb6fbc2a728f3e62b3 (patch)
treee4b7ada3652978fc7c8d9285660a34b3be1a5c36 /include/linux/iomap.h
parentiomap: move the SEEK_HOLE code into a separate file (diff)
downloadkernel-qcow2-linux-db074436f421967f4f30cfbb6fbc2a728f3e62b3.tar.gz
kernel-qcow2-linux-db074436f421967f4f30cfbb6fbc2a728f3e62b3.tar.xz
kernel-qcow2-linux-db074436f421967f4f30cfbb6fbc2a728f3e62b3.zip
iomap: move the direct IO code into a separate file
Move the direct IO code into a separate file so that we can group related functions in a single file instead of having a single enormous source file. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/iomap.h')
-rw-r--r--include/linux/iomap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 1df9ea187a9a..baa1e2d31f05 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -7,6 +7,7 @@
#include <linux/mm.h>
#include <linux/types.h>
#include <linux/mm_types.h>
+#include <linux/blkdev.h>
struct address_space;
struct fiemap_extent_info;
@@ -69,6 +70,12 @@ struct iomap {
const struct iomap_page_ops *page_ops;
};
+static inline sector_t
+iomap_sector(struct iomap *iomap, loff_t pos)
+{
+ return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT;
+}
+
/*
* When a filesystem sets page_ops in an iomap mapping it returns, page_prepare
* and page_done will be called for each page written to. This only applies to