New prototype for test_ReFS()
This commit is contained in:
parent
fa13fc1389
commit
3b7828ee1b
2 changed files with 11 additions and 7 deletions
|
@ -61,6 +61,7 @@
|
|||
#include "md.h"
|
||||
#include "netware.h"
|
||||
#include "ntfs.h"
|
||||
#include "refs.h"
|
||||
#include "rfs.h"
|
||||
#include "sun.h"
|
||||
#include "sysv.h"
|
||||
|
@ -424,6 +425,9 @@ static int check_part_none(disk_t *disk_car,const int verbose,partition_t *parti
|
|||
if(ret!=0)
|
||||
{ screen_buffer_add("Invalid RAID superblock\n"); }
|
||||
break;
|
||||
case UP_ReFS:
|
||||
ret=check_ReFS(disk_car, partition);
|
||||
break;
|
||||
case UP_RFS:
|
||||
case UP_RFS2:
|
||||
case UP_RFS3:
|
||||
|
|
14
src/refs.c
14
src/refs.c
|
@ -34,20 +34,20 @@
|
|||
#include "common.h"
|
||||
#include "refs.h"
|
||||
|
||||
static void set_ReFS_info(partition_t *partition, const struct ReFS_boot_sector *refs_header)
|
||||
static void set_ReFS_info(partition_t *partition)
|
||||
{
|
||||
partition->upart_type=UP_ReFS;
|
||||
partition->fsname[0]='\0';
|
||||
partition->info[0]='\0';
|
||||
snprintf(partition->info, sizeof(partition->info), "ReFS");
|
||||
}
|
||||
|
||||
static int test_ReFS(const struct ReFS_boot_sector *refs_header, partition_t *partition)
|
||||
static int test_ReFS(const struct ReFS_boot_sector *refs_header)
|
||||
{
|
||||
if(refs_header->fsname!=be32(0x52654653))
|
||||
return 1;
|
||||
if(refs_header->identifier!=be32(0x46535253))
|
||||
return 1;
|
||||
partition->upart_type=UP_ReFS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -59,25 +59,25 @@ int check_ReFS(disk_t *disk, partition_t *partition)
|
|||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
if(test_ReFS((struct ReFS_boot_sector*)buffer, partition)!=0)
|
||||
if(test_ReFS((struct ReFS_boot_sector*)buffer)!=0)
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
set_ReFS_info(partition, (struct ReFS_boot_sector*)buffer);
|
||||
set_ReFS_info(partition);
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int recover_ReFS(const disk_t *disk, const struct ReFS_boot_sector *refs_header, partition_t *partition)
|
||||
{
|
||||
if(test_ReFS(refs_header, partition)!=0)
|
||||
if(test_ReFS(refs_header)!=0)
|
||||
return 1;
|
||||
partition->sborg_offset=0;
|
||||
partition->sb_size=0x200;
|
||||
partition->part_type_i386=P_NTFS;
|
||||
partition->part_type_gpt=GPT_ENT_TYPE_MS_BASIC_DATA;
|
||||
partition->part_size=disk->sector_size;
|
||||
set_ReFS_info(partition, refs_header);
|
||||
set_ReFS_info(partition);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue