summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2009-04-22 14:08:13 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 07:37:33 +0200
commitdb2dbb12dc47a50c7a4c5678f526014063e486f6 (patch)
tree8bfa3fe41e674f584eb37a7767c008d609b41d75
parentblock: enable by default support for large devices and files on 32-bit archs (diff)
downloadlinux-db2dbb12dc47a50c7a4c5678f526014063e486f6.tar.xz
linux-db2dbb12dc47a50c7a4c5678f526014063e486f6.zip
block: implement blkdev_readpages
Doing a proper block dev ->readpages() speeds up the crazy dump(8) approach of using interleaved process IO. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fs/block_dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index f45dbc18dd17..a85fe310fc6f 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -331,6 +331,12 @@ static int blkdev_readpage(struct file * file, struct page * page)
return block_read_full_page(page, blkdev_get_block);
}
+static int blkdev_readpages(struct file *file, struct address_space *mapping,
+ struct list_head *pages, unsigned nr_pages)
+{
+ return mpage_readpages(mapping, pages, nr_pages, blkdev_get_block);
+}
+
static int blkdev_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
@@ -1399,6 +1405,7 @@ static int blkdev_releasepage(struct page *page, gfp_t wait)
static const struct address_space_operations def_blk_aops = {
.readpage = blkdev_readpage,
+ .readpages = blkdev_readpages,
.writepage = blkdev_writepage,
.sync_page = block_sync_page,
.write_begin = blkdev_write_begin,