Thread (34 messages) 34 messages, 3 authors, 2021-11-25

Re: [PATCH 25/25] btrfs: track the csum, extent, and free space trees in a rb tree

From: David Sterba <hidden>
Date: 2021-11-18 12:22:47

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);
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help