Commit db2dbb12 authored by Jeff Moyer's avatar Jeff Moyer Committed by Jens Axboe

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: default avatarJeff Moyer <jmoyer@redhat.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent db29a6b4
...@@ -331,6 +331,12 @@ static int blkdev_readpage(struct file * file, struct page * page) ...@@ -331,6 +331,12 @@ static int blkdev_readpage(struct file * file, struct page * page)
return block_read_full_page(page, blkdev_get_block); 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, static int blkdev_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags, loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata) struct page **pagep, void **fsdata)
...@@ -1399,6 +1405,7 @@ static int blkdev_releasepage(struct page *page, gfp_t wait) ...@@ -1399,6 +1405,7 @@ static int blkdev_releasepage(struct page *page, gfp_t wait)
static const struct address_space_operations def_blk_aops = { static const struct address_space_operations def_blk_aops = {
.readpage = blkdev_readpage, .readpage = blkdev_readpage,
.readpages = blkdev_readpages,
.writepage = blkdev_writepage, .writepage = blkdev_writepage,
.sync_page = block_sync_page, .sync_page = block_sync_page,
.write_begin = blkdev_write_begin, .write_begin = blkdev_write_begin,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment