All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Qu Wenruo <wqu@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v4 6/7] btrfs: Introduce new incompat feature, SKINNY_BG_TREE, to hugely reduce mount time
Date: Tue, 5 May 2020 19:10:53 +0000	[thread overview]
Message-ID: <SN4PR0401MB359872C31B77B386876AC78F9BA70@SN4PR0401MB3598.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20200504235825.4199-7-wqu@suse.com

On 05/05/2020 01:58, Qu Wenruo wrote:
> int btrfs_read_block_groups(struct btrfs_fs_info *info)
>   {
>   	struct btrfs_path *path;
> @@ -2022,20 +2124,27 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
>   	if (btrfs_test_opt(info, CLEAR_CACHE))
>   		need_clear = 1;
>   
> -	while (1) {
> -		ret = find_first_block_group(info, path, &key);
> -		if (ret > 0)
> -			break;
> -		if (ret != 0)
> -			goto error;
> +	if (btrfs_fs_incompat(info, SKINNY_BG_TREE)) {
> +		path->reada = READA_FORWARD;
> +		ret = read_skinny_block_groups(info, path, need_clear);
> +	} else {
> +		while (1) {
> +			ret = find_first_block_group(info, path, &key);
> +			if (ret > 0)
> +				break;
> +			if (ret != 0)
> +				goto error;
>   
> -		btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
> -		ret = read_one_block_group(info, path, &key, need_clear);
> -		if (ret < 0)
> -			goto error;
> -		key.objectid += key.offset;
> -		key.offset = 0;
> -		btrfs_release_path(path);
> +			btrfs_item_key_to_cpu(path->nodes[0], &key,
> +						path->slots[0]);
> +			ret = read_one_block_group(info, path, &key,
> +						need_clear);
> +			if (ret < 0)
> +				goto error;
> +			key.objectid += key.offset;
> +			key.offset = 0;
> +			btrfs_release_path(path);
> +		}
>   	}
>   

It might be worth considering to move the 'else' path into a function on 
it's own, similar what you did with read_skinny_block_groups().

  reply	other threads:[~2020-05-05 19:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 23:58 [PATCH v4 0/7] btrfs: Introduce new incompat feature SKINNY_BG_TREE to hugely reduce mount time Qu Wenruo
2020-05-04 23:58 ` [PATCH v4 1/7] btrfs: block-group: Don't set the wrong READA flag for btrfs_read_block_groups() Qu Wenruo
2020-05-04 23:58 ` [PATCH v4 2/7] btrfs: block-group: Refactor how we read one block group item Qu Wenruo
2020-05-04 23:58 ` [PATCH v4 3/7] btrfs: block-group: Refactor how we delete " Qu Wenruo
2020-05-05  8:47   ` Johannes Thumshirn
2020-05-05  8:55     ` Qu Wenruo
2020-05-05  8:56       ` Johannes Thumshirn
2020-05-04 23:58 ` [PATCH v4 4/7] btrfs: block-group: Refactor how we insert a " Qu Wenruo
2020-05-05  8:59   ` Johannes Thumshirn
2020-05-04 23:58 ` [PATCH v4 5/7] btrfs: block-group: Rename write_one_cahce_group() Qu Wenruo
2020-05-05  9:11   ` Johannes Thumshirn
2020-05-11 19:19   ` David Sterba
2020-05-04 23:58 ` [PATCH v4 6/7] btrfs: Introduce new incompat feature, SKINNY_BG_TREE, to hugely reduce mount time Qu Wenruo
2020-05-05 19:10   ` Johannes Thumshirn [this message]
2020-05-04 23:58 ` [PATCH v4 7/7] btrfs: tree-checker: Introduce checks for skinny block group item Qu Wenruo
2020-05-11 19:21 ` [PATCH v4 0/7] btrfs: Introduce new incompat feature SKINNY_BG_TREE to hugely reduce mount time 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=SN4PR0401MB359872C31B77B386876AC78F9BA70@SN4PR0401MB3598.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.