diff mbox series

[01/26] btrfs-progs: stop using add_root_to_dirty_list in check

Message ID 767d1929fdc767e2603ffe16699acb838b533f96.1682799405.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: sync ctree.c into btrfs-progs | expand

Commit Message

Josef Bacik April 29, 2023, 8:19 p.m. UTC
This is used to make sure the root is updated in the tree_root when we
re-init the root, however this function is static in the kernel and
doesn't need to be exported for any reason.  Simply update the root item
and then update it in the tree_root instead of adding it to the dirty
list.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/check/main.c b/check/main.c
index 8714c213..d9c54deb 100644
--- a/check/main.c
+++ b/check/main.c
@@ -9163,8 +9163,12 @@  static int btrfs_fsck_reinit_root(struct btrfs_trans_handle *trans,
 
 	free_extent_buffer(root->node);
 	root->node = c;
-	add_root_to_dirty_list(root);
-	return 0;
+
+	btrfs_set_root_bytenr(&root->root_item, c->start);
+	btrfs_set_root_generation(&root->root_item, trans->transid);
+
+	return btrfs_update_root(trans, gfs_info->tree_root, &root->root_key,
+				 &root->root_item);
 }
 
 static int reset_block_groups(void)