diff mbox series

[02/18] btrfs-progs: add btrfs_root_id helper

Message ID 832cc319f165f64cfd22a80e18de666b29e80520.1681939316.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: more prep work for syncing ctree.c | expand

Commit Message

Josef Bacik April 19, 2023, 9:23 p.m. UTC
This exists in the kernel and is used throughout ctree.c, sync this
helper to make sync'ing ctree.c easier.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 kernel-shared/ctree.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 655b714f..d5cd7803 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -476,6 +476,11 @@  struct btrfs_root {
 	struct rb_node rb_node;
 };
 
+static inline u64 btrfs_root_id(const struct btrfs_root *root)
+{
+	return root->root_key.objectid;
+}
+
 static inline u32 BTRFS_MAX_ITEM_SIZE(const struct btrfs_fs_info *info)
 {
 	return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item);