@@ -54,7 +54,7 @@ ssize_t btrfs_direct_pread(int fd, void *buf, size_t count, off_t offset);
ssize_t btrfs_direct_pwrite(int fd, const void *buf, size_t count, off_t offset);
#ifdef BTRFS_ZONED
-static inline ssize_t btrfs_pwrite(int fd, void *buf, size_t count,
+static inline ssize_t btrfs_pwrite(int fd, const void *buf, size_t count,
off_t offset, bool direct)
{
if (!direct)
@@ -62,8 +62,8 @@ static inline ssize_t btrfs_pwrite(int fd, void *buf, size_t count,
return btrfs_direct_pwrite(fd, buf, count, offset);
}
-static inline ssize_t btrfs_pread(int fd, void *buf, size_t count, off_t offset,
- bool direct)
+static inline ssize_t btrfs_pread(int fd, void *buf, size_t count,
+ off_t offset, bool direct)
{
if (!direct)
return pread(fd, buf, count, offset);
@@ -477,7 +477,7 @@ int read_data_from_disk(struct btrfs_fs_info *info, void *buf, u64 logical,
* Such data will be written to all mirrors and RAID56 P/Q will also be
* properly handled.
*/
-int write_data_to_disk(struct btrfs_fs_info *info, void *buf, u64 offset,
+int write_data_to_disk(struct btrfs_fs_info *info, const void *buf, u64 offset,
u64 bytes)
{
struct btrfs_multi_bio *multi = NULL;
@@ -128,7 +128,7 @@ int set_extent_buffer_dirty(struct extent_buffer *eb);
int btrfs_clear_buffer_dirty(struct extent_buffer *eb);
int read_data_from_disk(struct btrfs_fs_info *info, void *buf, u64 logical,
u64 *len, int mirror);
-int write_data_to_disk(struct btrfs_fs_info *info, void *buf, u64 offset,
+int write_data_to_disk(struct btrfs_fs_info *info, const void *buf, u64 offset,
u64 bytes);
void extent_buffer_bitmap_clear(struct extent_buffer *eb, unsigned long start,
unsigned long pos, unsigned long len);
The following functions accept a buffer for write, which can be marked as const: - btrfs_pwrite() - write_data_to_disk() Signed-off-by: Qu Wenruo <wqu@suse.com> --- common/device-utils.h | 6 +++--- kernel-shared/extent_io.c | 2 +- kernel-shared/extent_io.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)