ctree.c (11d6ae03557e34dd2bc9e57d1a5139ab3c7be54f) | ctree.c (f61aa7ba08abc09eaf8eb766d9469e9393c22dbf) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2007,2008 Oracle. All rights reserved. 4 */ 5 6#include <linux/sched.h> 7#include <linux/slab.h> 8#include <linux/rbtree.h> --- 2950 unchanged lines hidden (view full) --- 2959 WARN_ON(lower_gen != trans->transid); 2960 2961 btrfs_set_node_ptr_generation(c, 0, lower_gen); 2962 2963 btrfs_mark_buffer_dirty(c); 2964 2965 old = root->node; 2966 ret = btrfs_tree_mod_log_insert_root(root->node, c, false); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2007,2008 Oracle. All rights reserved. 4 */ 5 6#include <linux/sched.h> 7#include <linux/slab.h> 8#include <linux/rbtree.h> --- 2950 unchanged lines hidden (view full) --- 2959 WARN_ON(lower_gen != trans->transid); 2960 2961 btrfs_set_node_ptr_generation(c, 0, lower_gen); 2962 2963 btrfs_mark_buffer_dirty(c); 2964 2965 old = root->node; 2966 ret = btrfs_tree_mod_log_insert_root(root->node, c, false); |
2967 BUG_ON(ret < 0); | 2967 if (ret < 0) { 2968 btrfs_free_tree_block(trans, btrfs_root_id(root), c, 0, 1); 2969 btrfs_tree_unlock(c); 2970 free_extent_buffer(c); 2971 return ret; 2972 } |
2968 rcu_assign_pointer(root->node, c); 2969 2970 /* the super has an extra ref to root->node */ 2971 free_extent_buffer(old); 2972 2973 add_root_to_dirty_list(root); 2974 atomic_inc(&c->refs); 2975 path->nodes[level] = c; --- 2134 unchanged lines hidden --- | 2973 rcu_assign_pointer(root->node, c); 2974 2975 /* the super has an extra ref to root->node */ 2976 free_extent_buffer(old); 2977 2978 add_root_to_dirty_list(root); 2979 atomic_inc(&c->refs); 2980 path->nodes[level] = c; --- 2134 unchanged lines hidden --- |