block-group.c (dfe8aec4520bff8e69c8704421ef7f47c65ca778) block-group.c (29cbcf401793f4e2c871c846edc2191731df2c41)
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/list_sort.h>
4#include "misc.h"
5#include "ctree.h"
6#include "block-group.h"
7#include "space-info.h"
8#include "disk-io.h"

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

509
510 return total_added;
511}
512
513static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
514{
515 struct btrfs_block_group *block_group = caching_ctl->block_group;
516 struct btrfs_fs_info *fs_info = block_group->fs_info;
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/list_sort.h>
4#include "misc.h"
5#include "ctree.h"
6#include "block-group.h"
7#include "space-info.h"
8#include "disk-io.h"

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

509
510 return total_added;
511}
512
513static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
514{
515 struct btrfs_block_group *block_group = caching_ctl->block_group;
516 struct btrfs_fs_info *fs_info = block_group->fs_info;
517 struct btrfs_root *extent_root = fs_info->extent_root;
517 struct btrfs_root *extent_root;
518 struct btrfs_path *path;
519 struct extent_buffer *leaf;
520 struct btrfs_key key;
521 u64 total_found = 0;
522 u64 last = 0;
523 u32 nritems;
524 int ret;
525 bool wakeup = true;
526
527 path = btrfs_alloc_path();
528 if (!path)
529 return -ENOMEM;
530
531 last = max_t(u64, block_group->start, BTRFS_SUPER_INFO_OFFSET);
518 struct btrfs_path *path;
519 struct extent_buffer *leaf;
520 struct btrfs_key key;
521 u64 total_found = 0;
522 u64 last = 0;
523 u32 nritems;
524 int ret;
525 bool wakeup = true;
526
527 path = btrfs_alloc_path();
528 if (!path)
529 return -ENOMEM;
530
531 last = max_t(u64, block_group->start, BTRFS_SUPER_INFO_OFFSET);
532 extent_root = btrfs_extent_root(fs_info, last);
532
533#ifdef CONFIG_BTRFS_DEBUG
534 /*
535 * If we're fragmenting we don't want to make anybody think we can
536 * allocate from this block group until we've had a chance to fragment
537 * the free space.
538 */
539 if (btrfs_should_fragment_free_space(block_group))

--- 3512 unchanged lines hidden ---
533
534#ifdef CONFIG_BTRFS_DEBUG
535 /*
536 * If we're fragmenting we don't want to make anybody think we can
537 * allocate from this block group until we've had a chance to fragment
538 * the free space.
539 */
540 if (btrfs_should_fragment_free_space(block_group))

--- 3512 unchanged lines hidden ---