MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / test_MD

Function test_MD

src/md.c:40–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39#ifndef DISABLED_FOR_FRAMAC
40static int test_MD(const disk_t *disk_car, const struct mdp_superblock_s *sb, const partition_t *partition, const int dump_ind)
41{
42 if(le32(sb->md_magic)!=(unsigned int)MD_SB_MAGIC)
43 return 1;
44#ifndef DISABLED_FOR_FRAMAC
45 log_info("\nRaid magic value at %u/%u/%u\n",
46 offset2cylinder(disk_car,partition->part_offset),
47 offset2head(disk_car,partition->part_offset),
48 offset2sector(disk_car,partition->part_offset));
49 log_info("Raid apparent size: %llu sectors\n", (long long unsigned)(sb->size<<1));
50 if(le32(sb->major_version)==0)
51 {
52 /* chunk_size may be 0 */
53 log_info("Raid chunk size: %llu bytes\n", (long long unsigned)le32(sb->chunk_size));
54 }
55#endif
56 if(le32(sb->major_version)>1)
57 return 1;
58 if(dump_ind!=0)
59 {
60 /* There is a little offset ... */
61 dump_log(sb,DEFAULT_SECTOR_SIZE);
62 }
63 return 0;
64}
65
66static int test_MD_be(const disk_t *disk_car, const struct mdp_superblock_s *sb, const partition_t *partition, const int dump_ind)
67{

Callers 2

check_MDFunction · 0.85
recover_MDFunction · 0.85

Calls 4

offset2cylinderFunction · 0.85
offset2headFunction · 0.85
offset2sectorFunction · 0.85
dump_logFunction · 0.85

Tested by

no test coverage detected