diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d59dddfb1f96..23c596cd1b98 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -714,8 +714,10 @@ retry: | |||
714 | async_extent->ram_size - 1, 0); | 714 | async_extent->ram_size - 1, 0); |
715 | 715 | ||
716 | em = alloc_extent_map(); | 716 | em = alloc_extent_map(); |
717 | if (!em) | 717 | if (!em) { |
718 | ret = -ENOMEM; | ||
718 | goto out_free_reserve; | 719 | goto out_free_reserve; |
720 | } | ||
719 | em->start = async_extent->start; | 721 | em->start = async_extent->start; |
720 | em->len = async_extent->ram_size; | 722 | em->len = async_extent->ram_size; |
721 | em->orig_start = em->start; | 723 | em->orig_start = em->start; |
@@ -922,8 +924,10 @@ static noinline int __cow_file_range(struct btrfs_trans_handle *trans, | |||
922 | } | 924 | } |
923 | 925 | ||
924 | em = alloc_extent_map(); | 926 | em = alloc_extent_map(); |
925 | if (!em) | 927 | if (!em) { |
928 | ret = -ENOMEM; | ||
926 | goto out_reserve; | 929 | goto out_reserve; |
930 | } | ||
927 | em->start = start; | 931 | em->start = start; |
928 | em->orig_start = em->start; | 932 | em->orig_start = em->start; |
929 | ram_size = ins.offset; | 933 | ram_size = ins.offset; |
@@ -4723,6 +4727,7 @@ void btrfs_evict_inode(struct inode *inode) | |||
4723 | btrfs_end_transaction(trans, root); | 4727 | btrfs_end_transaction(trans, root); |
4724 | btrfs_btree_balance_dirty(root); | 4728 | btrfs_btree_balance_dirty(root); |
4725 | no_delete: | 4729 | no_delete: |
4730 | btrfs_remove_delayed_node(inode); | ||
4726 | clear_inode(inode); | 4731 | clear_inode(inode); |
4727 | return; | 4732 | return; |
4728 | } | 4733 | } |
@@ -4838,14 +4843,13 @@ static void inode_tree_add(struct inode *inode) | |||
4838 | struct rb_node **p; | 4843 | struct rb_node **p; |
4839 | struct rb_node *parent; | 4844 | struct rb_node *parent; |
4840 | u64 ino = btrfs_ino(inode); | 4845 | u64 ino = btrfs_ino(inode); |
4841 | again: | ||
4842 | p = &root->inode_tree.rb_node; | ||
4843 | parent = NULL; | ||
4844 | 4846 | ||
4845 | if (inode_unhashed(inode)) | 4847 | if (inode_unhashed(inode)) |
4846 | return; | 4848 | return; |
4847 | 4849 | again: | |
4850 | parent = NULL; | ||
4848 | spin_lock(&root->inode_lock); | 4851 | spin_lock(&root->inode_lock); |
4852 | p = &root->inode_tree.rb_node; | ||
4849 | while (*p) { | 4853 | while (*p) { |
4850 | parent = *p; | 4854 | parent = *p; |
4851 | entry = rb_entry(parent, struct btrfs_inode, rb_node); | 4855 | entry = rb_entry(parent, struct btrfs_inode, rb_node); |
@@ -8000,7 +8004,6 @@ void btrfs_destroy_inode(struct inode *inode) | |||
8000 | inode_tree_del(inode); | 8004 | inode_tree_del(inode); |
8001 | btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); | 8005 | btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); |
8002 | free: | 8006 | free: |
8003 | btrfs_remove_delayed_node(inode); | ||
8004 | call_rcu(&inode->i_rcu, btrfs_i_callback); | 8007 | call_rcu(&inode->i_rcu, btrfs_i_callback); |
8005 | } | 8008 | } |
8006 | 8009 | ||