@@ -731,7 +731,7 @@ static inline unsigned long btrfs_header_fsid(void)
return offsetof(struct btrfs_header, fsid);
}
-static inline unsigned long btrfs_header_chunk_tree_uuid(struct extent_buffer *eb)
+static inline unsigned long btrfs_header_chunk_tree_uuid(const struct extent_buffer *eb)
{
return offsetof(struct btrfs_header, chunk_tree_uuid);
}
@@ -659,6 +659,13 @@ void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv)
write_extent_buffer(eb, srcv, btrfs_header_fsid(), BTRFS_FSID_SIZE);
}
+void write_extent_buffer_chunk_tree_uuid(const struct extent_buffer *eb,
+ const void *srcv)
+{
+ write_extent_buffer(eb, srcv, btrfs_header_chunk_tree_uuid(eb),
+ BTRFS_FSID_SIZE);
+}
+
/*
* btrfs_readahead_node_child - readahead a node's child block
* @node: parent node we're reading from
@@ -143,5 +143,7 @@ void extent_buffer_init_cache(struct btrfs_fs_info *fs_info);
void extent_buffer_free_cache(struct btrfs_fs_info *fs_info);
void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv);
void btrfs_readahead_node_child(struct extent_buffer *node, int slot);
+void write_extent_buffer_chunk_tree_uuid(const struct extent_buffer *eb,
+ const void *src);
#endif
This exists in the kernel to update the chunk tree uuid on the btrfs_header. Add the helper to btrfs-progs to make future kernel sync changes easier. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/ctree.h | 2 +- kernel-shared/extent_io.c | 7 +++++++ kernel-shared/extent_io.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-)