btrfs: constify buffers used by compression helpers
authorDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 16:58:04 +0000 (17:58 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 28 Feb 2017 13:26:07 +0000 (14:26 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/lzo.c

index f32e86b612404c73fa550ac979a0aeecf31c4976..d426e4a10b2bc8d8e691769d77a9ad48f70bdc63 100644 (file)
@@ -1015,7 +1015,7 @@ void btrfs_exit_compress(void)
  *
  * total_out is the last byte of the buffer
  */
-int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
+int btrfs_decompress_buf2page(const char *buf, unsigned long buf_start,
                              unsigned long total_out, u64 disk_start,
                              struct bio *bio)
 {
index 09879579fbc83d29ac9e199fa4507ff75fc5b244..1c700bb20b52fd91701807a91f4cf9125098ce7d 100644 (file)
@@ -32,7 +32,7 @@ int btrfs_compress_pages(int type, struct address_space *mapping,
                         unsigned long max_out);
 int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,
                     unsigned long start_byte, size_t srclen, size_t destlen);
-int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
+int btrfs_decompress_buf2page(const char *buf, unsigned long buf_start,
                              unsigned long total_out, u64 disk_start,
                              struct bio *bio);
 
index 45d26980caf97db422e2bfb80da4f165ea7c8623..e074b85aa0542f51e69ca10f6b65247ed3cab756 100644 (file)
@@ -76,7 +76,7 @@ static inline void write_compress_length(char *buf, size_t len)
        memcpy(buf, &dlen, LZO_LEN);
 }
 
-static inline size_t read_compress_length(char *buf)
+static inline size_t read_compress_length(const char *buf)
 {
        __le32 dlen;