linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h
Date: Thu, 15 Sep 2022 14:10:18 +0800	[thread overview]
Message-ID: <464fbf8f-93e4-920f-d59d-0e8f5b6d5173@oracle.com> (raw)
In-Reply-To: <6f4bd25183fd8844b5592259971ed4e060d9018c.1663196541.git.josef@toxicpanda.com>

On 15/09/2022 07:04, Josef Bacik wrote:
> 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.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

> ---
>   fs/btrfs/block-group.c |  3 ++-
>   fs/btrfs/block-group.h |  8 ++++++++
>   fs/btrfs/ctree.h       | 14 --------------
>   3 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 20da92ae5c6b..e21382a13fe4 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -1940,7 +1940,8 @@ static struct btrfs_block_group *btrfs_create_block_group_cache(
>   	btrfs_init_free_space_ctl(cache, cache->free_space_ctl);
>   	atomic_set(&cache->frozen, 0);
>   	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;
>   }
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index 558fa0a21fb4..6c970a486b68 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -76,6 +76,14 @@ struct btrfs_caching_control {
>   /* Once caching_thread() finds this much free space, it will wake up waiters. */
>   #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_fs_info *fs_info;
>   	struct inode *inode;
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 725c187d5c4b..12d626e78182 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -180,14 +180,6 @@ struct btrfs_free_cluster {
>   	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. */
>   /*
>    * Async discard uses multiple lists to differentiate the discard filter
> @@ -1944,12 +1936,6 @@ int btrfs_scrub_cancel(struct btrfs_fs_info *info);
>   int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
>   int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
>   			 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 */
>   void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);


  reply	other threads:[~2022-09-15  6:10 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
2022-09-15  6:09   ` Anand Jain
2022-09-15 14:34   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
2022-09-15  6:10   ` Anand Jain [this message]
2022-09-15 14:38   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
2022-09-15  6:11   ` Anand Jain
2022-09-15 14:42   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
2022-09-15 10:37   ` Anand Jain
2022-09-15 14:43   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
2022-09-15 10:38   ` Anand Jain
2022-09-15 14:44   ` Johannes Thumshirn
2022-09-20 12:21   ` David Sterba
2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
2022-09-15 10:42   ` Anand Jain
2022-09-15 14:45   ` Johannes Thumshirn
2022-09-19 20:54   ` David Sterba
2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
2022-09-15 10:44   ` Anand Jain
2022-09-19 21:22   ` David Sterba
2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
2022-09-15 10:45   ` Anand Jain
2022-09-15 14:47   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
2022-09-15 10:47   ` Anand Jain
2022-09-15 14:47   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
2022-09-15 11:28   ` Anand Jain
2022-09-15 14:50   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
2022-09-15 11:29   ` Anand Jain
2022-09-15 14:50   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
2022-09-15 11:39   ` Anand Jain
2022-09-15 14:51   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
2022-09-15 12:43   ` Anand Jain
2022-09-15 14:52   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
2022-09-15 13:01   ` Anand Jain
2022-09-15 14:53   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
2022-09-15 13:06   ` Anand Jain
2022-09-15 14:54   ` Johannes Thumshirn
2022-09-20 11:44 ` [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=464fbf8f-93e4-920f-d59d-0e8f5b6d5173@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).