Btrfs: Add readpages support

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 90cb71d..d6d3246 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1748,7 +1748,6 @@
 	return extent_write_full_page(tree, page, btrfs_get_extent, wbc);
 }
 
-
 static int btrfs_writepages(struct address_space *mapping,
 			    struct writeback_control *wbc)
 {
@@ -1757,6 +1756,16 @@
 	return extent_writepages(tree, mapping, btrfs_get_extent, wbc);
 }
 
+static int
+btrfs_readpages(struct file *file, struct address_space *mapping,
+		struct list_head *pages, unsigned nr_pages)
+{
+	struct extent_map_tree *tree;
+	tree = &BTRFS_I(mapping->host)->extent_tree;
+	return extent_readpages(tree, mapping, pages, nr_pages,
+				btrfs_get_extent);
+}
+
 static int btrfs_releasepage(struct page *page, gfp_t unused_gfp_flags)
 {
 	struct extent_map_tree *tree;
@@ -2537,6 +2546,7 @@
 	.readpage	= btrfs_readpage,
 	.writepage	= btrfs_writepage,
 	.writepages	= btrfs_writepages,
+	.readpages	= btrfs_readpages,
 	.sync_page	= block_sync_page,
 	.prepare_write	= btrfs_prepare_write,
 	.commit_write	= btrfs_commit_write,