linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zach Brown <zach.brown@oracle.com>
To: linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>, David Chinner <dgc@sgi.com>
Subject: [PATCH 4/4] add dio interface for page/offset/len tuples
Date: Tue,  6 Nov 2007 17:43:31 -0800	[thread overview]
Message-ID: <11943998111855-git-send-email-zach.brown@oracle.com> (raw)
In-Reply-To: <1194399811773-git-send-email-zach.brown@oracle.com>

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


  reply	other threads:[~2007-11-07  1:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  1:43 [RFC] fs io with struct page instead of iovecs Zach Brown
2007-11-07  1:43 ` [PATCH 1/4] struct rwmem: an abstraction of the memory argument to read/write Zach Brown
2007-11-07  1:43   ` [PATCH 2/4] dio: use rwmem to work with r/w memory arguments Zach Brown
2007-11-07  1:43     ` [PATCH 3/4] add rwmem type backed by pages Zach Brown
2007-11-07  1:43       ` Zach Brown [this message]
2007-11-07 16:50 ` [RFC] fs io with struct page instead of iovecs Badari Pulavarty
2007-11-07 17:02   ` Zach Brown
2007-11-07 20:44     ` David Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11943998111855-git-send-email-zach.brown@oracle.com \
    --to=zach.brown@oracle.com \
    --cc=dgc@sgi.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).