diff options
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 2afb7922b062..f2c1dd40c087 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -69,7 +69,6 @@ struct buffer_head *btrfs_find_create_tree_block(struct btrfs_root *root, | |||
69 | if (!page) | 69 | if (!page) |
70 | return NULL; | 70 | return NULL; |
71 | 71 | ||
72 | wait_on_page_writeback(page); | ||
73 | if (!page_has_buffers(page)) | 72 | if (!page_has_buffers(page)) |
74 | create_empty_buffers(page, root->fs_info->sb->s_blocksize, 0); | 73 | create_empty_buffers(page, root->fs_info->sb->s_blocksize, 0); |
75 | head = page_buffers(page); | 74 | head = page_buffers(page); |
@@ -300,11 +299,12 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
300 | fs_info->btree_inode->i_mapping->a_ops = &btree_aops; | 299 | fs_info->btree_inode->i_mapping->a_ops = &btree_aops; |
301 | mapping_set_gfp_mask(fs_info->btree_inode->i_mapping, GFP_NOFS); | 300 | mapping_set_gfp_mask(fs_info->btree_inode->i_mapping, GFP_NOFS); |
302 | fs_info->hash_tfm = crypto_alloc_hash("sha256", 0, CRYPTO_ALG_ASYNC); | 301 | fs_info->hash_tfm = crypto_alloc_hash("sha256", 0, CRYPTO_ALG_ASYNC); |
303 | if (!fs_info->hash_tfm) { | 302 | spin_lock_init(&fs_info->hash_lock); |
303 | |||
304 | if (!fs_info->hash_tfm || IS_ERR(fs_info->hash_tfm)) { | ||
304 | printk("failed to allocate sha256 hash\n"); | 305 | printk("failed to allocate sha256 hash\n"); |
305 | return NULL; | 306 | return NULL; |
306 | } | 307 | } |
307 | spin_lock_init(&fs_info->hash_lock); | ||
308 | 308 | ||
309 | mutex_init(&fs_info->trans_mutex); | 309 | mutex_init(&fs_info->trans_mutex); |
310 | mutex_init(&fs_info->fs_mutex); | 310 | mutex_init(&fs_info->fs_mutex); |
@@ -394,6 +394,7 @@ int close_ctree(struct btrfs_root *root) | |||
394 | btrfs_block_release(root, root->commit_root); | 394 | btrfs_block_release(root, root->commit_root); |
395 | btrfs_block_release(root, root->fs_info->sb_buffer); | 395 | btrfs_block_release(root, root->fs_info->sb_buffer); |
396 | crypto_free_hash(root->fs_info->hash_tfm); | 396 | crypto_free_hash(root->fs_info->hash_tfm); |
397 | truncate_inode_pages(root->fs_info->btree_inode->i_mapping, 0); | ||
397 | iput(root->fs_info->btree_inode); | 398 | iput(root->fs_info->btree_inode); |
398 | kfree(root->fs_info->extent_root); | 399 | kfree(root->fs_info->extent_root); |
399 | kfree(root->fs_info->inode_root); | 400 | kfree(root->fs_info->inode_root); |