diff options
author | David Sterba <dsterba@suse.com> | 2022-11-07 17:30:21 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:55 +0100 |
commit | 3e09b5b2293f21e6e28929b6bbb73833678bfdd1 (patch) | |
tree | 42a3de25723bc151c4903d046e1f25147acd017f /fs/btrfs/compression.c | |
parent | ad3daf1c3f5bcbba49a302d8d0e46467556bf6f3 (diff) |
btrfs: constify input buffer parameter in compression code
The input buffers passed down to compression must never be changed,
switch type to u8 as it's a raw byte buffer and use const.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 42e6dde2ad59..30adf430241e 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -119,7 +119,7 @@ static int compression_decompress_bio(struct list_head *ws, } static int compression_decompress(int type, struct list_head *ws, - unsigned char *data_in, struct page *dest_page, + const u8 *data_in, struct page *dest_page, unsigned long start_byte, size_t srclen, size_t destlen) { switch (type) { @@ -1232,7 +1232,7 @@ static int btrfs_decompress_bio(struct compressed_bio *cb) * single page, and we want to read a single page out of it. * start_byte tells us the offset into the compressed data we're interested in */ -int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page, +int btrfs_decompress(int type, const u8 *data_in, struct page *dest_page, unsigned long start_byte, size_t srclen, size_t destlen) { struct list_head *workspace; |