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

Function test_JFS

src/jfs.c:53–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static int test_JFS(const disk_t *disk_car, const struct jfs_superblock *sb, const partition_t *partition, const int dump_ind)
54{
55 if(memcmp(sb->s_magic,"JFS1",4)!=0)
56 return 1;
57 /* Blocksize must be a multiple of 512 */
58 if(le32(sb->s_bsize)<512 ||
59 ((le32(sb->s_bsize)-1) & le32(sb->s_bsize))!=0)
60 return 1;
61 if(dump_ind!=0)
62 {
63 log_info("\nJFS magic value at %u/%u/%u\n", offset2cylinder(disk_car,partition->part_offset),offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset));
64 /* There is a little offset ... */
65 dump_log(sb,DEFAULT_SECTOR_SIZE);
66 }
67 /*
68 if( le32(sb->s_agsize) >= (1 << L2BPERDMAP) ) {
69 return 2;
70 }
71 if(partition->part_size!=0 && (partition->part_size<le64(sb->s_size)))
72 return 8;
73 */
74 return 0;
75}
76
77int check_JFS(disk_t *disk_car, partition_t *partition)
78{

Callers 2

check_JFSFunction · 0.85
recover_JFSFunction · 0.85

Calls 4

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

Tested by

no test coverage detected