[PATCH 4/4] add dio interface for page/offset/len tuples

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

 



This is what it might look like to feed pgol in to some part of the fs stack
instead of iovecs.  I imagine we'd want to do it at a much higher level, perhaps
something like vfs_write_pages().
---
 fs/direct-io.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 0d5ed41..e86bcbc 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1213,3 +1213,24 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
 }
 
 EXPORT_SYMBOL(__blockdev_direct_IO);
+
+ssize_t
+__blockdev_direct_IO_pages(int rw, struct kiocb *iocb, struct inode *inode,
+	struct block_device *bdev, struct pgol *pgol, loff_t offset, 
+	unsigned long nr_pages, get_block_t get_block, dio_iodone_t end_io,
+	int dio_lock_type)
+{
+	struct rwmem_pages rwp = {
+		.rwmem.ops = &rwmem_pages_ops,
+		.rwmem.nr_segs = nr_pages,
+		.pgol = pgol,
+	};
+	struct rwmem *rwm = &rwp.rwmem;
+
+	rwm->ops->init(rwm);
+
+	return blockdev_direct_IO_rwmem(rw, iocb, inode, bdev, rwm, offset,
+					get_block, end_io, dio_lock_type);
+}
+
+EXPORT_SYMBOL(__blockdev_direct_IO_pages);
-- 
1.5.2.2

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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