diff options
| author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-22 19:49:27 -0400 |
|---|---|---|
| committer | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-22 19:49:27 -0400 |
| commit | f056878332a91ed984a116bad4e7d49aefff9e6e (patch) | |
| tree | 572f4757c8e7811d45e0be0c2ae529c78fb63441 /fs/btrfs/disk-io.c | |
| parent | 3961f7c3cf247eee5df7fabadc7a40f2deeb98f3 (diff) | |
| parent | 7fa07729e439a6184bd824746d06a49cca553f15 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/power/wm97xx_battery.c
Diffstat (limited to 'fs/btrfs/disk-io.c')
| -rw-r--r-- | fs/btrfs/disk-io.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d28d29c95f7c..6c4173146bb7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -772,7 +772,7 @@ static void btree_invalidatepage(struct page *page, unsigned long offset) | |||
| 772 | } | 772 | } |
| 773 | } | 773 | } |
| 774 | 774 | ||
| 775 | static struct address_space_operations btree_aops = { | 775 | static const struct address_space_operations btree_aops = { |
| 776 | .readpage = btree_readpage, | 776 | .readpage = btree_readpage, |
| 777 | .writepage = btree_writepage, | 777 | .writepage = btree_writepage, |
| 778 | .writepages = btree_writepages, | 778 | .writepages = btree_writepages, |
| @@ -1352,6 +1352,7 @@ static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | |||
| 1352 | { | 1352 | { |
| 1353 | int err; | 1353 | int err; |
| 1354 | 1354 | ||
| 1355 | bdi->name = "btrfs"; | ||
| 1355 | bdi->capabilities = BDI_CAP_MAP_COPY; | 1356 | bdi->capabilities = BDI_CAP_MAP_COPY; |
| 1356 | err = bdi_init(bdi); | 1357 | err = bdi_init(bdi); |
| 1357 | if (err) | 1358 | if (err) |
| @@ -1599,6 +1600,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1599 | 1600 | ||
| 1600 | sb->s_blocksize = 4096; | 1601 | sb->s_blocksize = 4096; |
| 1601 | sb->s_blocksize_bits = blksize_bits(4096); | 1602 | sb->s_blocksize_bits = blksize_bits(4096); |
| 1603 | sb->s_bdi = &fs_info->bdi; | ||
| 1602 | 1604 | ||
| 1603 | /* | 1605 | /* |
| 1604 | * we set the i_size on the btree inode to the max possible int. | 1606 | * we set the i_size on the btree inode to the max possible int. |
| @@ -1639,6 +1641,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1639 | mutex_init(&fs_info->cleaner_mutex); | 1641 | mutex_init(&fs_info->cleaner_mutex); |
| 1640 | mutex_init(&fs_info->volume_mutex); | 1642 | mutex_init(&fs_info->volume_mutex); |
| 1641 | mutex_init(&fs_info->tree_reloc_mutex); | 1643 | mutex_init(&fs_info->tree_reloc_mutex); |
| 1644 | init_rwsem(&fs_info->extent_commit_sem); | ||
| 1642 | 1645 | ||
| 1643 | btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); | 1646 | btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); |
| 1644 | btrfs_init_free_cluster(&fs_info->data_alloc_cluster); | 1647 | btrfs_init_free_cluster(&fs_info->data_alloc_cluster); |
| @@ -1799,6 +1802,11 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1799 | btrfs_super_chunk_root(disk_super), | 1802 | btrfs_super_chunk_root(disk_super), |
| 1800 | blocksize, generation); | 1803 | blocksize, generation); |
| 1801 | BUG_ON(!chunk_root->node); | 1804 | BUG_ON(!chunk_root->node); |
| 1805 | if (!test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) { | ||
| 1806 | printk(KERN_WARNING "btrfs: failed to read chunk root on %s\n", | ||
| 1807 | sb->s_id); | ||
| 1808 | goto fail_chunk_root; | ||
| 1809 | } | ||
| 1802 | btrfs_set_root_node(&chunk_root->root_item, chunk_root->node); | 1810 | btrfs_set_root_node(&chunk_root->root_item, chunk_root->node); |
| 1803 | chunk_root->commit_root = btrfs_root_node(chunk_root); | 1811 | chunk_root->commit_root = btrfs_root_node(chunk_root); |
| 1804 | 1812 | ||
| @@ -1826,6 +1834,11 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1826 | blocksize, generation); | 1834 | blocksize, generation); |
| 1827 | if (!tree_root->node) | 1835 | if (!tree_root->node) |
| 1828 | goto fail_chunk_root; | 1836 | goto fail_chunk_root; |
| 1837 | if (!test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) { | ||
| 1838 | printk(KERN_WARNING "btrfs: failed to read tree root on %s\n", | ||
| 1839 | sb->s_id); | ||
| 1840 | goto fail_tree_root; | ||
| 1841 | } | ||
| 1829 | btrfs_set_root_node(&tree_root->root_item, tree_root->node); | 1842 | btrfs_set_root_node(&tree_root->root_item, tree_root->node); |
| 1830 | tree_root->commit_root = btrfs_root_node(tree_root); | 1843 | tree_root->commit_root = btrfs_root_node(tree_root); |
| 1831 | 1844 | ||
| @@ -2322,6 +2335,9 @@ int close_ctree(struct btrfs_root *root) | |||
| 2322 | printk(KERN_ERR "btrfs: commit super ret %d\n", ret); | 2335 | printk(KERN_ERR "btrfs: commit super ret %d\n", ret); |
| 2323 | } | 2336 | } |
| 2324 | 2337 | ||
| 2338 | fs_info->closing = 2; | ||
| 2339 | smp_mb(); | ||
| 2340 | |||
| 2325 | if (fs_info->delalloc_bytes) { | 2341 | if (fs_info->delalloc_bytes) { |
| 2326 | printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n", | 2342 | printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n", |
| 2327 | (unsigned long long)fs_info->delalloc_bytes); | 2343 | (unsigned long long)fs_info->delalloc_bytes); |
| @@ -2343,6 +2359,7 @@ int close_ctree(struct btrfs_root *root) | |||
| 2343 | free_extent_buffer(root->fs_info->csum_root->commit_root); | 2359 | free_extent_buffer(root->fs_info->csum_root->commit_root); |
| 2344 | 2360 | ||
| 2345 | btrfs_free_block_groups(root->fs_info); | 2361 | btrfs_free_block_groups(root->fs_info); |
| 2362 | btrfs_free_pinned_extents(root->fs_info); | ||
| 2346 | 2363 | ||
| 2347 | del_fs_roots(fs_info); | 2364 | del_fs_roots(fs_info); |
| 2348 | 2365 | ||
