On Fri, Nov 05, 2021 at 04:45:51PM -0400, Josef Bacik wrote:
quoted hunk ↗ jump to hunk
@@ -1242,6 +1243,82 @@ struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info)
}
#endif
+static int global_root_cmp(struct rb_node *a_node, const struct rb_node *b_node)
+{
+ struct btrfs_root *a = rb_entry(a_node, struct btrfs_root, rb_node);
+ struct btrfs_root *b = rb_entry(b_node, struct btrfs_root, rb_node);
Comparators can use some consts, at least for the local variables. The
rb_add_new comparator prototype has const only for the node, so
global_root_cmp is OK. I'll update the commit.
+ return btrfs_comp_cpu_keys(&a->root_key, &b->root_key);
+}