From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: junjie cai <junjiec@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][fat] use mpage_readpage when cluster size is page-alignment
Date: Wed, 28 Dec 2005 21:57:44 +0900 [thread overview]
Message-ID: <87u0ctwf93.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <ca992f110512272356l379dccc5k6288c28411ff7af4@mail.gmail.com> (junjie cai's message of "Wed, 28 Dec 2005 16:56:55 +0900")
junjie cai <junjiec@gmail.com> writes:
> it seems that mpage_read is faster then block_read_full_page
> when performing block-adjacent I/O.
> though not tested strictly, in a flash-based system,
> copying a 600k file reduced to 17ms from 30ms
Looks like good to me. Thanks for doing this.
I changed it recently, and it's waiting to open 2.6.16 in -mm tree.
The patch (fat-add-the-read-writepages.patch) is the following, but it
is using mpage_readpage() always. (also use mpage_xxxpages().)
Can't we use mpage_readpage() always? IIRC, that should work fine
without disadvantage.
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
fs/fat/inode.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletion(-)
diff -puN fs/fat/inode.c~fat-add-the-read-writepages fs/fat/inode.c
--- 25/fs/fat/inode.c~fat-add-the-read-writepages Mon Nov 7 17:02:07 2005
+++ 25-akpm/fs/fat/inode.c Mon Nov 7 17:02:07 2005
@@ -18,6 +18,7 @@
#include <linux/seq_file.h>
#include <linux/msdos_fs.h>
#include <linux/pagemap.h>
+#include <linux/mpage.h>
#include <linux/buffer_head.h>
#include <linux/mount.h>
#include <linux/vfs.h>
@@ -90,9 +91,21 @@ static int fat_writepage(struct page *pa
return block_write_full_page(page, fat_get_block, wbc);
}
+static int fat_writepages(struct address_space *mapping,
+ struct writeback_control *wbc)
+{
+ return mpage_writepages(mapping, wbc, fat_get_block);
+}
+
static int fat_readpage(struct file *file, struct page *page)
{
- return block_read_full_page(page, fat_get_block);
+ return mpage_readpage(page, fat_get_block);
+}
+
+static int fat_readpages(struct file *file, struct address_space *mapping,
+ struct list_head *pages, unsigned nr_pages)
+{
+ return mpage_readpages(mapping, pages, nr_pages, fat_get_block);
}
static int fat_prepare_write(struct file *file, struct page *page,
@@ -122,7 +135,9 @@ static sector_t _fat_bmap(struct address
static struct address_space_operations fat_aops = {
.readpage = fat_readpage,
+ .readpages = fat_readpages,
.writepage = fat_writepage,
+ .writepages = fat_writepages,
.sync_page = block_sync_page,
.prepare_write = fat_prepare_write,
.commit_write = fat_commit_write,
_
next prev parent reply other threads:[~2005-12-28 12:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-28 7:56 [RFC][fat] use mpage_readpage when cluster size is page-alignment junjie cai
[not found] ` <2cd57c900512280040g594ba003y@mail.gmail.com>
2005-12-28 9:36 ` junjie cai
2005-12-28 12:57 ` OGAWA Hirofumi [this message]
2005-12-29 6:38 ` cai
2005-12-29 8:06 ` Pekka Enberg
2005-12-29 8:52 ` cai
2005-12-29 9:12 ` Pekka J Enberg
2005-12-29 9:19 ` OGAWA Hirofumi
2005-12-29 10:24 ` cai
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=87u0ctwf93.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=junjiec@gmail.com \
--cc=linux-kernel@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 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.