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

Function check_rfs

src/rfs.c:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55int check_rfs(disk_t *disk_car,partition_t *partition,const int verbose)
56{
57 unsigned char *buffer=(unsigned char*)MALLOC(REISERFS_SUPER_BLOCK_SIZE);
58 if(disk_car->pread(disk_car, buffer, REISERFS_SUPER_BLOCK_SIZE, partition->part_offset + 128 * 512) != REISERFS_SUPER_BLOCK_SIZE) /* 64k offset */
59 {
60 free(buffer);
61 return 1;
62 }
63 if(test_rfs(disk_car, (struct reiserfs_super_block*)buffer, partition, verbose)==0)
64 {
65 set_rfs_info((struct reiserfs_super_block*)buffer, partition);
66 free(buffer);
67 return 0;
68 }
69 if(test_rfs4(disk_car, (struct reiser4_master_sb*)buffer, partition, verbose)==0)
70 {
71 set_rfs4_info((const struct reiser4_master_sb*)buffer, partition);
72 free(buffer);
73 return 0;
74 }
75 free(buffer);
76 return 1;
77}
78
79static int test_rfs(const disk_t *disk_car, const struct reiserfs_super_block *sb, const partition_t *partition, const int verbose)
80{

Callers 2

check_part_noneFunction · 0.85
check_linuxFunction · 0.85

Calls 5

MALLOCFunction · 0.85
test_rfsFunction · 0.85
set_rfs_infoFunction · 0.85
test_rfs4Function · 0.85
set_rfs4_infoFunction · 0.85

Tested by

no test coverage detected