summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-11-08 10:59:22 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:57 -0400
commit3ab2fb5a8cb003897016b6eb38ddad916226c1b2 (patch)
treedce5ac7ae586111c7e872193c09ced717b936549 /fs/btrfs/inode.c
parent856bf3e592f917e7d663cb7fa93e83fe795e8f4e (diff)
downloadlwn-3ab2fb5a8cb003897016b6eb38ddad916226c1b2.tar.gz
lwn-3ab2fb5a8cb003897016b6eb38ddad916226c1b2.zip
Btrfs: Add readpages support
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 90cb71d68294..d6d32465bc9a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1748,7 +1748,6 @@ static int btrfs_writepage(struct page *page, struct writeback_control *wbc)
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 @@ static int btrfs_writepages(struct address_space *mapping,
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 @@ static struct address_space_operations btrfs_aops = {
.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,