@@ -47,6 +47,7 @@ struct recover_control {
int yes;
u16 csum_size;
+ u16 csum_type;
u32 sectorsize;
u32 nodesize;
u64 generation;
@@ -1530,6 +1531,7 @@ static int recover_prepare(struct recover_control *rc, const char *path)
rc->generation = btrfs_super_generation(sb);
rc->chunk_root_generation = btrfs_super_chunk_root_generation(sb);
rc->csum_size = btrfs_super_csum_size(sb);
+ rc->csum_type = btrfs_super_csum_type(sb);
/* if seed, the result of scanning below will be partial */
if (btrfs_super_flags(sb) & BTRFS_SUPER_FLAG_SEEDING) {
@@ -165,7 +165,9 @@ struct btrfs_free_space_ctl;
#define BTRFS_CSUM_SIZE 32
/* csum types */
-#define BTRFS_CSUM_TYPE_CRC32 0
+enum btrfs_csum_type {
+ BTRFS_CSUM_TYPE_CRC32 = 0,
+};
/* four bytes for CRC32 */
static int btrfs_csum_sizes[] = { 4 };