diff options
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r-- | fs/btrfs/root-tree.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index b48650de4472..0ddc6d61c55a 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -111,6 +111,15 @@ out: | |||
111 | return ret; | 111 | return ret; |
112 | } | 112 | } |
113 | 113 | ||
114 | int btrfs_set_root_node(struct btrfs_root_item *item, | ||
115 | struct extent_buffer *node) | ||
116 | { | ||
117 | btrfs_set_root_bytenr(item, node->start); | ||
118 | btrfs_set_root_level(item, btrfs_header_level(node)); | ||
119 | btrfs_set_root_generation(item, btrfs_header_generation(node)); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
114 | /* | 123 | /* |
115 | * copy the data in 'item' into the btree | 124 | * copy the data in 'item' into the btree |
116 | */ | 125 | */ |
@@ -164,8 +173,7 @@ int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root | |||
164 | * offset lower than the latest root. They need to be queued for deletion to | 173 | * offset lower than the latest root. They need to be queued for deletion to |
165 | * finish what was happening when we crashed. | 174 | * finish what was happening when we crashed. |
166 | */ | 175 | */ |
167 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid, | 176 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid) |
168 | struct btrfs_root *latest) | ||
169 | { | 177 | { |
170 | struct btrfs_root *dead_root; | 178 | struct btrfs_root *dead_root; |
171 | struct btrfs_item *item; | 179 | struct btrfs_item *item; |
@@ -227,10 +235,7 @@ again: | |||
227 | goto err; | 235 | goto err; |
228 | } | 236 | } |
229 | 237 | ||
230 | if (objectid == BTRFS_TREE_RELOC_OBJECTID) | 238 | ret = btrfs_add_dead_root(dead_root); |
231 | ret = btrfs_add_dead_reloc_root(dead_root); | ||
232 | else | ||
233 | ret = btrfs_add_dead_root(dead_root, latest); | ||
234 | if (ret) | 239 | if (ret) |
235 | goto err; | 240 | goto err; |
236 | goto again; | 241 | goto again; |