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

Function test_f2fs

src/f2fs.c:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70int test_f2fs(const struct f2fs_super_block *hdr)
71{
72 if(le32(hdr->magic) != F2FS_SUPER_MAGIC)
73 return 1;
74 /* Currently, support 512/1024/2048/4096 bytes sector size */
75 if(le32(hdr->log_sectorsize) < 9 || le32(hdr->log_sectorsize) > 12)
76 return 1;
77 /* Currently, support only 4KB block size */
78 if(le32(hdr->log_blocksize) != F2FS_BLKSIZE_BITS)
79 return 1;
80 if(le32(hdr->log_sectorsize) + le32(hdr->log_sectors_per_block) != le32(hdr->log_blocksize))
81 return 1;
82 /* check log blocks per segment */
83 if(le32(hdr->log_blocks_per_seg) != 9)
84 return 1;
85 if(le64(hdr->block_count) == 0)
86 return 1;
87 return 0;
88}
89
90int recover_f2fs(const disk_t *disk, const struct f2fs_super_block *hdr, partition_t *partition)
91{

Callers 2

check_f2fsFunction · 0.85
recover_f2fsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected