瀏覽代碼

btrfs: constify buffers used by compression helpers

Signed-off-by: David Sterba <dsterba@suse.com>
David Sterba 8 年之前
父節點
當前提交
14a3357b40
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      fs/btrfs/compression.c
  2. 1 1
      fs/btrfs/compression.h
  3. 1 1
      fs/btrfs/lzo.c

+ 1 - 1
fs/btrfs/compression.c

@@ -1015,7 +1015,7 @@ void btrfs_exit_compress(void)
  *
  *
  * total_out is the last byte of the buffer
  * 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,
 			      unsigned long total_out, u64 disk_start,
 			      struct bio *bio)
 			      struct bio *bio)
 {
 {

+ 1 - 1
fs/btrfs/compression.h

@@ -32,7 +32,7 @@ int btrfs_compress_pages(int type, struct address_space *mapping,
 			 unsigned long max_out);
 			 unsigned long max_out);
 int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,
 int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,
 		     unsigned long start_byte, size_t srclen, size_t destlen);
 		     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,
 			      unsigned long total_out, u64 disk_start,
 			      struct bio *bio);
 			      struct bio *bio);
 
 

+ 1 - 1
fs/btrfs/lzo.c

@@ -76,7 +76,7 @@ static inline void write_compress_length(char *buf, size_t len)
 	memcpy(buf, &dlen, LZO_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;
 	__le32 dlen;