From: Badari Pulavarty <pbadari@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, hch@lst.de, miklos@szeredi.hu, nathans@sgi.com,
reiser@namesys.com, swhiteho@redhat.com, vs@namesys.com
Subject: [PATCH -mm only] Pass IO size to batch_write() address space operation
Date: Mon, 24 Jul 2006 10:50:29 -0700 [thread overview]
Message-ID: <44C50865.3000403@us.ibm.com> (raw)
In-Reply-To: <200607091208.k69C8umv021827@shell0.pdx.osdl.net>
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
Hi,
Here is the patch to pass size of the remaining IO to batch_write()
interface.
I would like to use it ext3/ext4 to allocate in chunks. Currently its
passing
only the size of the current buffer (in the vector entry).
Comments ? Flames ? Looks reasonable ?
Thanks,
Badari
[-- Attachment #2: pass_io_size_to_batch_write.patch --]
[-- Type: text/plain, Size: 1831 bytes --]
Pass remaining size of this IO to batch_write(). This
way filesystems could choose to allocate for the entire IO,
instead of current buffer size.
I would like to use this for setting ext3 reservation window
or allocating entire extent (ext4).
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
include/linux/fs.h | 2 ++
mm/filemap.c | 1 +
2 files changed, 3 insertions(+)
Index: linux-2.6.18-rc1/include/linux/fs.h
===================================================================
--- linux-2.6.18-rc1.orig/include/linux/fs.h 2006-07-24 10:12:18.000000000 -0700
+++ linux-2.6.18-rc1/include/linux/fs.h 2006-07-24 10:35:51.000000000 -0700
@@ -356,6 +356,7 @@ struct writeback_control;
* struct write_descriptor - set of write arguments
* @pos: offset from the start of the file to write to
* @count: number of bytes to write
+ * @iosize: remaining number of bytes in the IO
* @buf: pointer to data to be written
* @lru_pvec: multipage container to batch adding pages to LRU list
* @cached_page: allocated but not used on previous call
@@ -366,6 +367,7 @@ struct writeback_control;
struct write_descriptor {
loff_t pos;
size_t count;
+ size_t iosize;
char __user *buf;
struct page *cached_page;
struct pagevec *lru_pvec;
Index: linux-2.6.18-rc1/mm/filemap.c
===================================================================
--- linux-2.6.18-rc1.orig/mm/filemap.c 2006-07-24 10:12:20.000000000 -0700
+++ linux-2.6.18-rc1/mm/filemap.c 2006-07-24 10:36:44.000000000 -0700
@@ -2278,6 +2278,7 @@ generic_file_buffered_write(struct kiocb
do {
/* do not walk over current segment */
desc.buf = cur_iov->iov_base + iov_base;
+ desc.iosize = count;
desc.count = min(count, cur_iov->iov_len - iov_base);
if (desc.count > 0)
status = (*batch_write)(file, &desc, &copied);
parent reply other threads:[~2006-07-24 17:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200607091208.k69C8umv021827@shell0.pdx.osdl.net>]
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=44C50865.3000403@us.ibm.com \
--to=pbadari@us.ibm.com \
--cc=akpm@osdl.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=nathans@sgi.com \
--cc=reiser@namesys.com \
--cc=swhiteho@redhat.com \
--cc=vs@namesys.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.