linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v2 15/30] btrfs-progs: check-lowmem: use the btrfs_block_group_root helper
Date: Wed, 10 Nov 2021 15:14:27 -0500	[thread overview]
Message-ID: <bc42616990fea95fcf408441bd66a8c0054bb87a.1636575146.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1636575146.git.josef@toxicpanda.com>

When we're messing with block group items use the
btrfs_block_group_root() helper to get the correct root to search, and
this will do the right thing based on the file system flags.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/mode-lowmem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index cc6773cd..263b56d1 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -266,7 +266,7 @@ static int modify_block_group_cache(struct btrfs_block_group *block_group, int c
  */
 static int modify_block_groups_cache(u64 flags, int cache)
 {
-	struct btrfs_root *root = btrfs_extent_root(gfs_info, 0);
+	struct btrfs_root *root = btrfs_block_group_root(gfs_info);
 	struct btrfs_key key;
 	struct btrfs_path path;
 	struct btrfs_block_group *bg_cache;
@@ -331,7 +331,7 @@ static int clear_block_groups_full(u64 flags)
 static int create_chunk_and_block_group(u64 flags, u64 *start, u64 *nbytes)
 {
 	struct btrfs_trans_handle *trans;
-	struct btrfs_root *root = btrfs_extent_root(gfs_info, 0);
+	struct btrfs_root *root = btrfs_block_group_root(gfs_info);
 	int ret;
 
 	if ((flags & BTRFS_BLOCK_GROUP_TYPE_MASK) == 0)
@@ -419,7 +419,7 @@ static int is_chunk_almost_full(u64 start)
 {
 	struct btrfs_path path;
 	struct btrfs_key key;
-	struct btrfs_root *root = btrfs_extent_root(gfs_info, 0);
+	struct btrfs_root *root = btrfs_block_group_root(gfs_info);
 	struct btrfs_block_group_item *bi;
 	struct btrfs_block_group_item bg_item;
 	struct extent_buffer *eb;
@@ -4591,7 +4591,7 @@ next:
 static int find_block_group_item(struct btrfs_path *path, u64 bytenr, u64 len,
 				 u64 type)
 {
-	struct btrfs_root *root = btrfs_extent_root(gfs_info, 0);
+	struct btrfs_root *root = btrfs_block_group_root(gfs_info);
 	struct btrfs_block_group_item bgi;
 	struct btrfs_key key;
 	int ret;
-- 
2.26.3


  parent reply	other threads:[~2021-11-10 20:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 20:14 [PATCH v2 00/30] btrfs-progs: extent tree v2 support, global roots Josef Bacik
2021-11-10 20:14 ` [PATCH v2 01/30] btrfs-progs: stop accessing ->extent_root directly Josef Bacik
2021-11-10 20:14 ` [PATCH v2 02/30] btrfs-progs: stop accessing ->free_space_root directly Josef Bacik
2021-11-10 20:14 ` [PATCH v2 03/30] btrfs-progs: track csum, extent, and free space trees in a rb tree Josef Bacik
2021-11-10 20:14 ` [PATCH v2 04/30] btrfs-progs: check: make reinit work per found root item Josef Bacik
2021-11-10 20:14 ` [PATCH v2 05/30] btrfs-progs: check: check the global roots for uptodate root nodes Josef Bacik
2021-11-10 20:14 ` [PATCH v2 06/30] btrfs-progs: check: check all of the csum roots Josef Bacik
2021-11-10 20:14 ` [PATCH v2 07/30] btrfs-progs: check: fill csum root from all extent roots Josef Bacik
2021-11-10 20:14 ` [PATCH v2 08/30] btrfs-progs: common: search all extent roots for marking used space Josef Bacik
2021-11-10 20:14 ` [PATCH v2 09/30] btrfs-progs: common: allow users to select extent-tree-v2 option Josef Bacik
2021-11-10 20:14 ` [PATCH v2 10/30] btrfs-progs: add definitions for the block group tree Josef Bacik
2021-11-10 20:14 ` [PATCH v2 11/30] btrfs-progs: add on disk pointers to global tree ids Josef Bacik
2021-11-10 20:14 ` [PATCH v2 12/30] btrfs-progs: add support for loading the block group root Josef Bacik
2021-11-10 20:14 ` [PATCH v2 13/30] btrfs-progs: add print support for the block group tree Josef Bacik
2021-11-10 20:14 ` [PATCH v2 14/30] btrfs-progs: mkfs: use the btrfs_block_group_root helper Josef Bacik
2021-11-10 20:14 ` Josef Bacik [this message]
2021-11-10 20:14 ` [PATCH v2 16/30] btrfs-progs: handle no bg item in extent tree for free space tree Josef Bacik
2021-11-10 20:14 ` [PATCH v2 17/30] btrfs-progs: mkfs: add support for the block group tree Josef Bacik
2021-11-10 20:14 ` [PATCH v2 18/30] btrfs-progs: check: add block group tree support Josef Bacik
2021-11-10 20:14 ` [PATCH v2 19/30] btrfs-progs: qgroup-verify: scan extents based on block groups Josef Bacik
2021-11-10 20:14 ` [PATCH v2 20/30] btrfs-progs: check: make free space tree validation extent tree v2 aware Josef Bacik
2021-11-10 20:14 ` [PATCH v2 21/30] btrfs-progs: check: add helper to reinit the root based on a key Josef Bacik
2021-11-10 20:14 ` [PATCH v2 22/30] btrfs-progs: check: handle the block group tree properly Josef Bacik
2021-11-10 20:14 ` [PATCH v2 23/30] btrfs-progs: load the number of global roots into the fs_info Josef Bacik
2021-11-10 20:14 ` [PATCH v2 24/30] btrfs-progs: handle the per-block group global root id Josef Bacik
2021-11-10 20:14 ` [PATCH v2 25/30] btrfs-progs: add a btrfs_delete_and_free_root helper Josef Bacik
2021-11-10 20:14 ` [PATCH v2 26/30] btrfs-progs: make btrfs_clear_free_space_tree extent tree v2 aware Josef Bacik
2021-11-10 20:14 ` [PATCH v2 27/30] btrfs-progs: make btrfs_create_tree take a key for the root key Josef Bacik
2021-11-10 20:14 ` [PATCH v2 28/30] btrfs-progs: mkfs: set chunk_item_objectid properly for extent tree v2 Josef Bacik
2021-11-10 20:14 ` [PATCH v2 29/30] btrfs-progs: mkfs: create the global root's Josef Bacik
2021-11-15 20:51   ` David Sterba
2021-11-16 14:45     ` [PATCH v3] " Josef Bacik
2021-11-10 20:14 ` [PATCH v2 30/30] btrfs-progs: check: don't do the root item check for extent tree v2 Josef Bacik

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=bc42616990fea95fcf408441bd66a8c0054bb87a.1636575146.git.josef@toxicpanda.com \
    --to=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).