| 68 | } |
| 69 | |
| 70 | int 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 | |
| 90 | int recover_f2fs(const disk_t *disk, const struct f2fs_super_block *hdr, partition_t *partition) |
| 91 | { |
no outgoing calls
no test coverage detected