From e380421ff2b4cd145b92608d2c9042da34ddfff9 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 23 Nov 2022 17:37:33 -0500 Subject: [PATCH] btrfs-progs: make write_extent_buffer take a const eb This is what we do in the kernel, and while we're syncing individual files we're going to have state where some callers are using a const, but progs isn't. So adjust write_extent_buffer to take a const eb in order to make this less painful. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- kernel-shared/extent_io.c | 4 ++-- kernel-shared/extent_io.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel-shared/extent_io.c b/kernel-shared/extent_io.c index 6dbc95ad..016aa698 100644 --- a/kernel-shared/extent_io.c +++ b/kernel-shared/extent_io.c @@ -1067,10 +1067,10 @@ void read_extent_buffer(const struct extent_buffer *eb, void *dst, memcpy(dst, eb->data + start, len); } -void write_extent_buffer(struct extent_buffer *eb, const void *src, +void write_extent_buffer(const struct extent_buffer *eb, const void *src, unsigned long start, unsigned long len) { - memcpy(eb->data + start, src, len); + memcpy((void *)eb->data + start, src, len); } void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src, diff --git a/kernel-shared/extent_io.h b/kernel-shared/extent_io.h index 88fb6171..d824d467 100644 --- a/kernel-shared/extent_io.h +++ b/kernel-shared/extent_io.h @@ -145,7 +145,7 @@ int memcmp_extent_buffer(const struct extent_buffer *eb, const void *ptrv, unsigned long start, unsigned long len); void read_extent_buffer(const struct extent_buffer *eb, void *dst, unsigned long start, unsigned long len); -void write_extent_buffer(struct extent_buffer *eb, const void *src, +void write_extent_buffer(const struct extent_buffer *eb, const void *src, unsigned long start, unsigned long len); void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src, unsigned long dst_offset, unsigned long src_offset,