remove unsued parameters from check_btrfs() and recover_ISO()

This commit is contained in:
Christophe Grenier 2012-04-15 11:23:48 +02:00
parent 4ae38716d2
commit 32d529ddcd
6 changed files with 21 additions and 23 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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);