root-tree.c (1136fa0c07de570dc17858745af8be169d1440ba) root-tree.c (b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#include <linux/err.h>
7#include <linux/uuid.h>
8#include "ctree.h"

--- 264 unchanged lines hidden (view full) ---

273 "Failed to delete root orphan item");
274 break;
275 }
276 continue;
277 }
278
279 WARN_ON(!test_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state));
280 if (btrfs_root_refs(&root->root_item) == 0) {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#include <linux/err.h>
7#include <linux/uuid.h>
8#include "ctree.h"

--- 264 unchanged lines hidden (view full) ---

273 "Failed to delete root orphan item");
274 break;
275 }
276 continue;
277 }
278
279 WARN_ON(!test_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state));
280 if (btrfs_root_refs(&root->root_item) == 0) {
281 struct btrfs_key drop_key;
282
283 btrfs_disk_key_to_cpu(&drop_key, &root->root_item.drop_progress);
284 /*
285 * If we have a non-zero drop_progress then we know we
286 * made it partly through deleting this snapshot, and
287 * thus we need to make sure we block any balance from
288 * happening until this snapshot is completely dropped.
289 */
290 if (drop_key.objectid != 0 || drop_key.type != 0 ||
291 drop_key.offset != 0) {
292 set_bit(BTRFS_FS_UNFINISHED_DROPS, &fs_info->flags);
293 set_bit(BTRFS_ROOT_UNFINISHED_DROP, &root->state);
294 }
295
281 set_bit(BTRFS_ROOT_DEAD_TREE, &root->state);
282 btrfs_add_dead_root(root);
283 }
284 btrfs_put_root(root);
285 }
286
287 btrfs_free_path(path);
288 return err;

--- 242 unchanged lines hidden ---
296 set_bit(BTRFS_ROOT_DEAD_TREE, &root->state);
297 btrfs_add_dead_root(root);
298 }
299 btrfs_put_root(root);
300 }
301
302 btrfs_free_path(path);
303 return err;

--- 242 unchanged lines hidden ---