linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 3/3] btrfs: Introduce new incompat feature, BG_TREE, to speed up mount time
Date: Mon, 14 Oct 2019 17:08:05 +0800	[thread overview]
Message-ID: <16b15fd5-cee8-784b-31e9-d5473cd72474@oracle.com> (raw)
In-Reply-To: <20191010023928.24586-4-wqu@suse.com>





> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 044981cf6df9..1c5728e6a660 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1570,6 +1570,8 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
>   	if (location->objectid == BTRFS_FREE_SPACE_TREE_OBJECTID)
>   		return fs_info->free_space_root ? fs_info->free_space_root :
>   						  ERR_PTR(-ENOENT);
> +	if (location->objectid == BTRFS_BLOCK_GROUP_TREE_OBJECTID)


> +		return fs_info->bg_root ? fs_info->bg_root: ERR_PTR(-ENOENT);

  An explicit check is better than implicit check for example:
------------
return btrfs_fs_incompat(fs_info, BG_TREE) ? \
	fs_info->bg_root : ERR_PTR(-ENOENT);
------------


Thanks, Anand

  parent reply	other threads:[~2019-10-14  9:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  2:39 [PATCH v3 0/3] btrfs: Introduce new incompat feature BG_TREE to hugely reduce mount time Qu Wenruo
2019-10-10  2:39 ` [PATCH v3 1/3] btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group() Qu Wenruo
2019-10-10  2:51   ` Anand Jain
2019-10-10  7:20   ` Johannes Thumshirn
2019-10-11 19:23   ` David Sterba
2019-10-10  2:39 ` [PATCH v3 2/3] btrfs: block-group: Refactor btrfs_read_block_groups() Qu Wenruo
2019-10-10  2:52   ` Anand Jain
2019-10-30  4:59   ` Qu WenRuo
2019-11-04 19:53     ` David Sterba
2019-11-04 21:44       ` David Sterba
2019-11-05  0:47         ` Qu Wenruo
2019-11-04 19:55   ` David Sterba
2019-10-10  2:39 ` [PATCH v3 3/3] btrfs: Introduce new incompat feature, BG_TREE, to speed up mount time Qu Wenruo
2019-10-10  5:21   ` Naohiro Aota
2019-10-11 13:23   ` Josef Bacik
2019-10-14  9:08   ` Anand Jain [this message]
2019-10-10  2:40 ` [PATCH v3 0/3] btrfs: Introduce new incompat feature BG_TREE to hugely reduce " Qu WenRuo

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=16b15fd5-cee8-784b-31e9-d5473cd72474@oracle.com \
    --to=anand.jain@oracle.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 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).