Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964800AbVL1M6D (ORCPT ); Wed, 28 Dec 2005 07:58:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964805AbVL1M6C (ORCPT ); Wed, 28 Dec 2005 07:58:02 -0500 Received: from mail.parknet.co.jp ([210.171.160.6]:17677 "EHLO mail.parknet.co.jp") by vger.kernel.org with ESMTP id S964800AbVL1M6A (ORCPT ); Wed, 28 Dec 2005 07:58:00 -0500 To: junjie cai Cc: linux-kernel Subject: Re: [RFC][fat] use mpage_readpage when cluster size is page-alignment References: From: OGAWA Hirofumi Date: Wed, 28 Dec 2005 21:57:44 +0900 In-Reply-To: (junjie cai's message of "Wed, 28 Dec 2005 16:56:55 +0900") Message-ID: <87u0ctwf93.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2612 Lines: 81 junjie cai 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 From: OGAWA Hirofumi Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton --- 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 #include #include +#include #include #include #include @@ -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, _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/