From cc8b28226c5129079a34283a3c4337dc079781c5 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 25 Sep 2019 19:31:15 +0200 Subject: [PATCH] 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 --- ctree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctree.c b/ctree.c index 006cfad3..d1680a6a 100644 --- a/ctree.c +++ b/ctree.c @@ -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" },