diff --git a/src/analyse.c b/src/analyse.c index 874c8f7e..9201738c 100644 --- a/src/analyse.c +++ b/src/analyse.c @@ -418,7 +418,7 @@ int check_linux(disk_t *disk, partition_t *partition, const int verbose) check_cramfs(disk, partition, verbose)==0 || check_xfs(disk, partition, verbose)==0 || check_LUKS(disk, partition)==0 || - check_btrfs(disk, partition, verbose)==0 || + check_btrfs(disk, partition)==0 || check_gfs2(disk, partition)==0) return 0; return 1; diff --git a/src/btrfs.c b/src/btrfs.c index d99b8f49..911f0c0d 100644 --- a/src/btrfs.c +++ b/src/btrfs.c @@ -37,10 +37,21 @@ #include "log.h" #include "guid_cpy.h" -static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition, const int verbose); static int test_btrfs(const struct btrfs_super_block *sb, partition_t *partition); -int check_btrfs(disk_t *disk_car,partition_t *partition,const int verbose) +static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition) +{ + set_part_name(partition, sb->label, sizeof(partition->partname)); + strncpy(partition->info,"btrfs",sizeof(partition->info)); + if(le64(sb->bytenr)!=partition->part_offset + BTRFS_SUPER_INFO_OFFSET) + { + strcat(partition->info," Backup superblock"); + } + /* last mounted => date */ + return 0; +} + +int check_btrfs(disk_t *disk_car,partition_t *partition) { unsigned char *buffer=(unsigned char*)MALLOC(BTRFS_SUPER_INFO_SIZE); if(disk_car->pread(disk_car, buffer, BTRFS_SUPER_INFO_SIZE, partition->part_offset + BTRFS_SUPER_INFO_OFFSET) != BTRFS_SUPER_INFO_SIZE) @@ -53,23 +64,11 @@ int check_btrfs(disk_t *disk_car,partition_t *partition,const int verbose) free(buffer); return 1; } - set_btrfs_info((struct btrfs_super_block*)buffer, partition, verbose); + set_btrfs_info((struct btrfs_super_block*)buffer, partition); free(buffer); return 0; } -static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition, const int verbose) -{ - set_part_name(partition, sb->label, sizeof(partition->partname)); - strncpy(partition->info,"btrfs",sizeof(partition->info)); - if(le64(sb->bytenr)!=partition->part_offset + BTRFS_SUPER_INFO_OFFSET) - { - strcat(partition->info," Backup superblock"); - } - /* last mounted => date */ - return 0; -} - /* Primary superblock is at 1024 (SUPERBLOCK_OFFSET) Group 0 begin at s_first_data_block @@ -89,7 +88,7 @@ int recover_btrfs(disk_t *disk, const struct btrfs_super_block *sb, partition_t } if(partition==NULL) return 0; - set_btrfs_info(sb, partition, verbose); + set_btrfs_info(sb, partition); partition->part_type_i386=P_LINUX; partition->part_type_mac=PMAC_LINUX; partition->part_type_sun=PSUN_LINUX; diff --git a/src/btrfs.h b/src/btrfs.h index 04af24f3..26fb20eb 100644 --- a/src/btrfs.h +++ b/src/btrfs.h @@ -138,7 +138,7 @@ struct btrfs_super_block { uint8_t sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE]; } __attribute__ ((__packed__)); -int check_btrfs(disk_t *disk_car,partition_t *partition,const int verbose); +int check_btrfs(disk_t *disk_car,partition_t *partition); int recover_btrfs(disk_t *disk_car, const struct btrfs_super_block *sb,partition_t *partition,const int verbose, const int dump_ind); #ifdef __cplusplus diff --git a/src/iso.c b/src/iso.c index 7f15d63c..da29d31c 100644 --- a/src/iso.c +++ b/src/iso.c @@ -80,7 +80,7 @@ static int set_ISO_info(const struct iso_primary_descriptor *iso, partition_t *p return 0; } -int recover_ISO(disk_t *disk_car, const struct iso_primary_descriptor *iso, partition_t *partition, const int verbose, const int dump_ind) +int recover_ISO(const struct iso_primary_descriptor *iso, partition_t *partition) { if(test_ISO(iso, partition)!=0) return 1; diff --git a/src/iso.h b/src/iso.h index a9033f14..3567a92a 100644 --- a/src/iso.h +++ b/src/iso.h @@ -23,8 +23,7 @@ extern "C" { #endif int check_ISO(disk_t *disk_car, partition_t *partition); -int recover_ISO(disk_t *disk_car, const struct iso_primary_descriptor *iso, partition_t *partition, const int verbose, const int dump_ind); - +int recover_ISO(const struct iso_primary_descriptor *iso, partition_t *partition); #ifdef __cplusplus } /* closing brace for extern "C" */ #endif diff --git a/src/partnone.c b/src/partnone.c index badce65b..6c49e06b 100644 --- a/src/partnone.c +++ b/src/partnone.c @@ -222,7 +222,7 @@ static list_part_t *read_part_none(disk_t *disk, const int verbose, const int sa res=search_type_64(buffer_disk, disk, partition,verbose,0); } if(res<=0) - res=(recover_ISO(disk, (const struct iso_primary_descriptor*)(buffer_disk+0x200), partition, verbose, 0)==0); + res=(recover_ISO((const struct iso_primary_descriptor*)(buffer_disk+0x200), partition)==0); if(res<=0) { /* 64k offset */ @@ -332,7 +332,7 @@ static int check_part_none(disk_t *disk_car,const int verbose,partition_t *parti ret=check_BeFS(disk_car,partition); break; case UP_BTRFS: - ret=check_btrfs(disk_car, partition, verbose); + ret=check_btrfs(disk_car, partition); break; case UP_CRAMFS: ret=check_cramfs(disk_car,partition,verbose);