btrfs-progs: constify and reduce csum definition table

The table won't change at runtime and the string name can be in a buffer
avoiding the pointer indirection. Make one entry aligned to 16 bytes,
plenty of space to store reasonably long csum names.

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2019-09-25 19:31:15 +02:00
parent 3a73bc1b37
commit cc8b28226c
1 changed files with 2 additions and 2 deletions

View File

@ -38,9 +38,9 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
struct extent_buffer *dst_buf,
struct extent_buffer *src_buf);
static struct btrfs_csum {
static const struct btrfs_csum {
u16 size;
const char *name;
const char name[14];
} btrfs_csums[] = {
[BTRFS_CSUM_TYPE_CRC32] = { 4, "crc32c" },
[BTRFS_CSUM_TYPE_XXHASH] = { 8, "xxhash64" },