diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1e3e414c8501..30965120772b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2384,6 +2384,8 @@ int open_ctree(struct super_block *sb, | |||
2384 | init_waitqueue_head(&fs_info->transaction_blocked_wait); | 2384 | init_waitqueue_head(&fs_info->transaction_blocked_wait); |
2385 | init_waitqueue_head(&fs_info->async_submit_wait); | 2385 | init_waitqueue_head(&fs_info->async_submit_wait); |
2386 | 2386 | ||
2387 | INIT_LIST_HEAD(&fs_info->pinned_chunks); | ||
2388 | |||
2387 | ret = btrfs_alloc_stripe_hash_table(fs_info); | 2389 | ret = btrfs_alloc_stripe_hash_table(fs_info); |
2388 | if (ret) { | 2390 | if (ret) { |
2389 | err = ret; | 2391 | err = ret; |
@@ -3715,6 +3717,17 @@ void close_ctree(struct btrfs_root *root) | |||
3715 | 3717 | ||
3716 | btrfs_free_block_rsv(root, root->orphan_block_rsv); | 3718 | btrfs_free_block_rsv(root, root->orphan_block_rsv); |
3717 | root->orphan_block_rsv = NULL; | 3719 | root->orphan_block_rsv = NULL; |
3720 | |||
3721 | lock_chunks(root); | ||
3722 | while (!list_empty(&fs_info->pinned_chunks)) { | ||
3723 | struct extent_map *em; | ||
3724 | |||
3725 | em = list_first_entry(&fs_info->pinned_chunks, | ||
3726 | struct extent_map, list); | ||
3727 | list_del_init(&em->list); | ||
3728 | free_extent_map(em); | ||
3729 | } | ||
3730 | unlock_chunks(root); | ||
3718 | } | 3731 | } |
3719 | 3732 | ||
3720 | int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, | 3733 | int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, |