Skip to content

Commit b8f3290

Browse files
Johannes Thumshirnkdave
authored andcommitted
btrfs-progs: cache csum_type in recover_control
Cache the super-block's checksum type field in 'struct recover_control'. This will be needed for further refactoring the checksum handling. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent af56955 commit b8f3290

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmds/rescue-chunk-recover.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct recover_control {
4747
int yes;
4848

4949
u16 csum_size;
50+
u16 csum_type;
5051
u32 sectorsize;
5152
u32 nodesize;
5253
u64 generation;
@@ -1530,6 +1531,7 @@ static int recover_prepare(struct recover_control *rc, const char *path)
15301531
rc->generation = btrfs_super_generation(sb);
15311532
rc->chunk_root_generation = btrfs_super_chunk_root_generation(sb);
15321533
rc->csum_size = btrfs_super_csum_size(sb);
1534+
rc->csum_type = btrfs_super_csum_type(sb);
15331535

15341536
/* if seed, the result of scanning below will be partial */
15351537
if (btrfs_super_flags(sb) & BTRFS_SUPER_FLAG_SEEDING) {

0 commit comments

Comments
 (0)