@@ -163,7 +163,7 @@ static struct extent_buffer *alloc_dummy_eb(u64 bytenr, u32 size);
static void csum_block(u8 *buf, size_t len)
{
- char result[BTRFS_CRC32_SIZE];
+ u8 result[BTRFS_CRC32_SIZE];
u32 crc = ~(u32)0;
crc = crc32c(crc, buf + BTRFS_CSUM_SIZE, len - BTRFS_CSUM_SIZE);
btrfs_csum_final(crc, result);
@@ -1914,7 +1914,7 @@ static int check_one_csum(int fd, u64 start, u32 len, u32 tree_csum)
}
ret = 0;
csum_result = btrfs_csum_data(NULL, data, csum_result, len);
- btrfs_csum_final(csum_result, (char *)&csum_result);
+ btrfs_csum_final(csum_result, (u8 *)&csum_result);
if (csum_result != tree_csum)
ret = 1;
out:
@@ -5740,7 +5740,7 @@ again:
csum = btrfs_csum_data(NULL, (char *)data + tmp,
csum, root->sectorsize);
- btrfs_csum_final(csum, (char *)&csum);
+ btrfs_csum_final(csum, (u8 *)&csum);
csum_offset = leaf_offset +
tmp / root->sectorsize * csum_size;
@@ -37,7 +37,7 @@
static int check_csum_sblock(void *sb, int csum_size)
{
- char result[BTRFS_CSUM_SIZE];
+ u8 result[BTRFS_CSUM_SIZE];
u32 crc = ~(u32)0;
crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE,
@@ -123,7 +123,7 @@ u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len)
return crc32c(seed, data, len);
}
-void btrfs_csum_final(u32 crc, char *result)
+void btrfs_csum_final(u32 crc, u8 *result)
{
put_unaligned_le32(~crc, result);
}
@@ -131,7 +131,7 @@ void btrfs_csum_final(u32 crc, char *result)
static int __csum_tree_block_size(struct extent_buffer *buf, u16 csum_size,
int verify, int silent)
{
- char result[BTRFS_CSUM_SIZE];
+ u8 result[BTRFS_CSUM_SIZE];
u32 len;
u32 crc = ~(u32)0;
@@ -1423,7 +1423,7 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
*/
static int check_super(struct btrfs_super_block *sb, unsigned sbflags)
{
- char result[BTRFS_CSUM_SIZE];
+ u8 result[BTRFS_CSUM_SIZE];
u32 crc;
u16 csum_type;
int csum_size;
@@ -1647,7 +1647,7 @@ static int write_dev_supers(struct btrfs_root *root,
crc = ~(u32)0;
crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE, crc,
BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
- btrfs_csum_final(crc, (char *)&sb->csum[0]);
+ btrfs_csum_final(crc, &sb->csum[0]);
/*
* super_copy is BTRFS_SUPER_INFO_SIZE bytes and is
@@ -1671,7 +1671,7 @@ static int write_dev_supers(struct btrfs_root *root,
crc = ~(u32)0;
crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE, crc,
BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
- btrfs_csum_final(crc, (char *)&sb->csum[0]);
+ btrfs_csum_final(crc, &sb->csum[0]);
/*
* super_copy is BTRFS_SUPER_INFO_SIZE bytes and is
@@ -175,7 +175,7 @@ int btrfs_set_buffer_uptodate(struct extent_buffer *buf);
int wait_on_tree_block_writeback(struct btrfs_root *root,
struct extent_buffer *buf);
u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len);
-void btrfs_csum_final(u32 crc, char *result);
+void btrfs_csum_final(u32 crc, u8 *result);
int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
@@ -297,7 +297,7 @@ csum:
csum_offset * csum_size);
found:
csum_result = btrfs_csum_data(root, data, csum_result, len);
- btrfs_csum_final(csum_result, (char *)&csum_result);
+ btrfs_csum_final(csum_result, (u8 *)&csum_result);
if (csum_result == 0) {
printk("csum result is 0 for block %llu\n",
(unsigned long long)bytenr);
@@ -210,7 +210,7 @@ static int io_ctl_check_crc(struct io_ctl *io_ctl, int index)
io_ctl_map_page(io_ctl, 0);
crc = crc32c(crc, io_ctl->orig + offset, io_ctl->root->sectorsize - offset);
- btrfs_csum_final(crc, (char *)&crc);
+ btrfs_csum_final(crc, (u8 *)&crc);
if (val != crc) {
printk("btrfs: csum mismatch on free space cache\n");
io_ctl_unmap_page(io_ctl);
@@ -91,7 +91,7 @@ void free_recover_superblock(struct btrfs_recover_superblock *recover)
static int check_super(u64 bytenr, struct btrfs_super_block *sb)
{
int csum_size = btrfs_super_csum_size(sb);
- char result[csum_size];
+ u8 result[csum_size];
u32 crc = ~(u32)0;
if (btrfs_super_bytenr(sb) != bytenr)
@@ -223,7 +223,7 @@ static inline int write_temp_super(int fd, struct btrfs_super_block *sb,
crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE, crc,
BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
- btrfs_csum_final(crc, (char *)&sb->csum[0]);
+ btrfs_csum_final(crc, &sb->csum[0]);
ret = pwrite(fd, sb, BTRFS_SUPER_INFO_SIZE, sb_bytenr);
if (ret < BTRFS_SUPER_INFO_SIZE)
ret = (ret < 0 ? -errno : -EIO);
Signed-off-by: Domagoj Tršan <domagoj.trsan@gmail.com> --- btrfs-image.c | 2 +- chunk-recover.c | 2 +- cmds-check.c | 2 +- cmds-inspect-dump-super.c | 2 +- disk-io.c | 10 +++++----- disk-io.h | 2 +- file-item.c | 2 +- free-space-cache.c | 2 +- super-recover.c | 2 +- utils.c | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-)