diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-06-20 15:38:04 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 08:59:09 -0400 |
commit | 07730d87ac7872b54efa02da5d20b42fd6bb165a (patch) | |
tree | bc1f9b69ef68cf9fc6eb689820e2d30460c483b3 /fs/btrfs/ctree.h | |
parent | 606d1bf10d7ebafdee26e8896b467b885c5233ec (diff) |
btrfs: migrate the chunk allocation code
This feels more at home in block-group.c than in extent-tree.c.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>i
[ refresh ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 6b17573c2fe6..fe25b7211f2d 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2556,28 +2556,6 @@ enum btrfs_flush_state { | |||
2556 | COMMIT_TRANS = 9, | 2556 | COMMIT_TRANS = 9, |
2557 | }; | 2557 | }; |
2558 | 2558 | ||
2559 | /* | ||
2560 | * control flags for do_chunk_alloc's force field | ||
2561 | * CHUNK_ALLOC_NO_FORCE means to only allocate a chunk | ||
2562 | * if we really need one. | ||
2563 | * | ||
2564 | * CHUNK_ALLOC_LIMITED means to only try and allocate one | ||
2565 | * if we have very few chunks already allocated. This is | ||
2566 | * used as part of the clustering code to help make sure | ||
2567 | * we have a good pool of storage to cluster in, without | ||
2568 | * filling the FS with empty chunks | ||
2569 | * | ||
2570 | * CHUNK_ALLOC_FORCE means it must try to allocate one | ||
2571 | * | ||
2572 | */ | ||
2573 | enum btrfs_chunk_alloc_enum { | ||
2574 | CHUNK_ALLOC_NO_FORCE, | ||
2575 | CHUNK_ALLOC_LIMITED, | ||
2576 | CHUNK_ALLOC_FORCE, | ||
2577 | }; | ||
2578 | |||
2579 | int btrfs_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags, | ||
2580 | enum btrfs_chunk_alloc_enum force); | ||
2581 | int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, | 2559 | int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, |
2582 | struct btrfs_block_rsv *rsv, | 2560 | struct btrfs_block_rsv *rsv, |
2583 | int nitems, bool use_global_rsv); | 2561 | int nitems, bool use_global_rsv); |
@@ -2593,7 +2571,6 @@ int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info, | |||
2593 | u64 start, u64 end); | 2571 | u64 start, u64 end); |
2594 | int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr, | 2572 | int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr, |
2595 | u64 num_bytes, u64 *actual_bytes); | 2573 | u64 num_bytes, u64 *actual_bytes); |
2596 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type); | ||
2597 | int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range); | 2574 | int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range); |
2598 | 2575 | ||
2599 | int btrfs_init_space_info(struct btrfs_fs_info *fs_info); | 2576 | int btrfs_init_space_info(struct btrfs_fs_info *fs_info); |
@@ -2602,7 +2579,6 @@ int btrfs_delayed_refs_qgroup_accounting(struct btrfs_trans_handle *trans, | |||
2602 | int btrfs_start_write_no_snapshotting(struct btrfs_root *root); | 2579 | int btrfs_start_write_no_snapshotting(struct btrfs_root *root); |
2603 | void btrfs_end_write_no_snapshotting(struct btrfs_root *root); | 2580 | void btrfs_end_write_no_snapshotting(struct btrfs_root *root); |
2604 | void btrfs_wait_for_snapshot_creation(struct btrfs_root *root); | 2581 | void btrfs_wait_for_snapshot_creation(struct btrfs_root *root); |
2605 | void check_system_chunk(struct btrfs_trans_handle *trans, const u64 type); | ||
2606 | 2582 | ||
2607 | /* ctree.c */ | 2583 | /* ctree.c */ |
2608 | int btrfs_bin_search(struct extent_buffer *eb, const struct btrfs_key *key, | 2584 | int btrfs_bin_search(struct extent_buffer *eb, const struct btrfs_key *key, |