aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c547cca26a26..51d2e4de34eb 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -696,6 +696,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
696 __btree_submit_bio_done); 696 __btree_submit_bio_done);
697} 697}
698 698
699#ifdef CONFIG_MIGRATION
699static int btree_migratepage(struct address_space *mapping, 700static int btree_migratepage(struct address_space *mapping,
700 struct page *newpage, struct page *page) 701 struct page *newpage, struct page *page)
701{ 702{
@@ -712,12 +713,9 @@ static int btree_migratepage(struct address_space *mapping,
712 if (page_has_private(page) && 713 if (page_has_private(page) &&
713 !try_to_release_page(page, GFP_KERNEL)) 714 !try_to_release_page(page, GFP_KERNEL))
714 return -EAGAIN; 715 return -EAGAIN;
715#ifdef CONFIG_MIGRATION
716 return migrate_page(mapping, newpage, page); 716 return migrate_page(mapping, newpage, page);
717#else
718 return -ENOSYS;
719#endif
720} 717}
718#endif
721 719
722static int btree_writepage(struct page *page, struct writeback_control *wbc) 720static int btree_writepage(struct page *page, struct writeback_control *wbc)
723{ 721{
@@ -1009,7 +1007,10 @@ static int find_and_setup_root(struct btrfs_root *tree_root,
1009 blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item)); 1007 blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item));
1010 root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), 1008 root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item),
1011 blocksize, generation); 1009 blocksize, generation);
1012 BUG_ON(!root->node); 1010 if (!root->node || !btrfs_buffer_uptodate(root->node, generation)) {
1011 free_extent_buffer(root->node);
1012 return -EIO;
1013 }
1013 root->commit_root = btrfs_root_node(root); 1014 root->commit_root = btrfs_root_node(root);
1014 return 0; 1015 return 0;
1015} 1016}