@@ -82,9 +82,12 @@ struct btrfs_ref;
*/
#define BTRFS_LINK_MAX 65535U
-/* four bytes for CRC32 */
-static const int btrfs_csum_sizes[] = { 4 };
-static const char *btrfs_csum_names[] = { "crc32c" };
+static const struct btrfs_csums {
+ u16 size;
+ const char *name;
+} btrfs_csums[] = {
+ [BTRFS_CSUM_TYPE_CRC32] = { .size = 4, .name = "crc32c" },
+};
#define BTRFS_EMPTY_DIR_SIZE 0
@@ -2207,13 +2210,13 @@ static inline int btrfs_super_csum_size(const struct btrfs_super_block *s)
/*
* csum type is validated at mount time
*/
- return btrfs_csum_sizes[t];
+ return btrfs_csums[t].size;
}
static inline const char *btrfs_super_csum_name(u16 csum_type)
{
/* csum type is validated at mount time */
- return btrfs_csum_names[csum_type];
+ return btrfs_csums[csum_type].name;
}
/*