mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 15:58:47 +00:00
btrfs: move btrfs_full_stripe_locks_tree into block-group.h
This is actually embedded in struct btrfs_block_group, so move this definition to block-group.h, and then open-code the init of the tree where we init the rest of the block group instead of using a helper. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
16708a8898
commit
c29abab4f9
@ -1926,7 +1926,8 @@ static struct btrfs_block_group *btrfs_create_block_group_cache(
|
|||||||
btrfs_init_free_space_ctl(cache, cache->free_space_ctl);
|
btrfs_init_free_space_ctl(cache, cache->free_space_ctl);
|
||||||
atomic_set(&cache->frozen, 0);
|
atomic_set(&cache->frozen, 0);
|
||||||
mutex_init(&cache->free_space_lock);
|
mutex_init(&cache->free_space_lock);
|
||||||
btrfs_init_full_stripe_locks_tree(&cache->full_stripe_locks_root);
|
cache->full_stripe_locks_root.root = RB_ROOT;
|
||||||
|
mutex_init(&cache->full_stripe_locks_root.lock);
|
||||||
|
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,14 @@ struct btrfs_caching_control {
|
|||||||
/* Once caching_thread() finds this much free space, it will wake up waiters. */
|
/* Once caching_thread() finds this much free space, it will wake up waiters. */
|
||||||
#define CACHING_CTL_WAKE_UP SZ_2M
|
#define CACHING_CTL_WAKE_UP SZ_2M
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tree to record all locked full stripes of a RAID5/6 block group
|
||||||
|
*/
|
||||||
|
struct btrfs_full_stripe_locks_tree {
|
||||||
|
struct rb_root root;
|
||||||
|
struct mutex lock;
|
||||||
|
};
|
||||||
|
|
||||||
struct btrfs_block_group {
|
struct btrfs_block_group {
|
||||||
struct btrfs_fs_info *fs_info;
|
struct btrfs_fs_info *fs_info;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
@ -497,14 +497,6 @@ struct btrfs_free_cluster {
|
|||||||
struct list_head block_group_list;
|
struct list_head block_group_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Tree to record all locked full stripes of a RAID5/6 block group
|
|
||||||
*/
|
|
||||||
struct btrfs_full_stripe_locks_tree {
|
|
||||||
struct rb_root root;
|
|
||||||
struct mutex lock;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Discard control. */
|
/* Discard control. */
|
||||||
/*
|
/*
|
||||||
* Async discard uses multiple lists to differentiate the discard filter
|
* Async discard uses multiple lists to differentiate the discard filter
|
||||||
@ -4058,12 +4050,6 @@ int btrfs_scrub_cancel(struct btrfs_fs_info *info);
|
|||||||
int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
|
int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
|
||||||
int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
|
int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
|
||||||
struct btrfs_scrub_progress *progress);
|
struct btrfs_scrub_progress *progress);
|
||||||
static inline void btrfs_init_full_stripe_locks_tree(
|
|
||||||
struct btrfs_full_stripe_locks_tree *locks_root)
|
|
||||||
{
|
|
||||||
locks_root->root = RB_ROOT;
|
|
||||||
mutex_init(&locks_root->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dev-replace.c */
|
/* dev-replace.c */
|
||||||
void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
|
void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user