@@ -617,6 +617,12 @@ void copy_extent_buffer(const struct extent_buffer *dst,
memcpy((void *)dst->data + dst_offset, src->data + src_offset, len);
}
+void copy_extent_buffer_full(const struct extent_buffer *dst,
+ const struct extent_buffer *src)
+{
+ copy_extent_buffer(dst, src, 0, 0, src->len);
+}
+
void memmove_extent_buffer(const struct extent_buffer *dst, unsigned long dst_offset,
unsigned long src_offset, unsigned long len)
{
@@ -634,3 +640,8 @@ int extent_buffer_test_bit(const struct extent_buffer *eb, unsigned long start,
{
return le_test_bit(nr, (u8 *)eb->data + start);
}
+
+void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv)
+{
+ write_extent_buffer(eb, srcv, btrfs_header_fsid(), BTRFS_FSID_SIZE);
+}
@@ -114,6 +114,8 @@ void copy_extent_buffer(const struct extent_buffer *dst,
const struct extent_buffer *src,
unsigned long dst_offset, unsigned long src_offset,
unsigned long len);
+void copy_extent_buffer_full(const struct extent_buffer *dst,
+ const struct extent_buffer *src);
void memmove_extent_buffer(const struct extent_buffer *dst,
const unsigned long dst_offset,
unsigned long src_offset, unsigned long len);
@@ -133,5 +135,6 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start,
unsigned long pos, unsigned long len);
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);
#endif
The following are some extent buffer helpers we have in the kernel but not in btrfs-progs. Sync these in to make syncing ctree.c easier. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/extent_io.c | 11 +++++++++++ kernel-shared/extent_io.h | 3 +++ 2 files changed, 14 insertions(+)