@@ -630,6 +630,12 @@ void copy_extent_buffer_full(const struct extent_buffer *dst,
copy_extent_buffer(dst, src, 0, 0, src->len);
}
+void memcpy_extent_buffer(const struct extent_buffer *dst, unsigned long dst_offset,
+ unsigned long src_offset, unsigned long len)
+{
+ memcpy((void *)dst->data + dst_offset, dst->data + src_offset, len);
+}
+
void memmove_extent_buffer(const struct extent_buffer *dst, unsigned long dst_offset,
unsigned long src_offset, unsigned long len)
{
@@ -118,6 +118,9 @@ void copy_extent_buffer(const struct extent_buffer *dst,
unsigned long len);
void copy_extent_buffer_full(const struct extent_buffer *dst,
const struct extent_buffer *src);
+void memcpy_extent_buffer(const struct extent_buffer *dst,
+ unsigned long dst_offset, unsigned long src_offset,
+ unsigned long len);
void memmove_extent_buffer(const struct extent_buffer *dst,
const unsigned long dst_offset,
unsigned long src_offset, unsigned long len);
We use this in ctree.c in the kernel, so sync this helper into btrfs-progs to make sync'ing ctree.c easier. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- kernel-shared/extent_io.c | 6 ++++++ kernel-shared/extent_io.h | 3 +++ 2 files changed, 9 insertions(+)