fat_unformat() * @param struct ph_param *params * @param const struct ph_options *options * @param alloc_data_t *list_search_space * * @returns: * 0: Completed or not possible * 1: Stop by user request * params->offset is set */
| 413 | * params->offset is set |
| 414 | */ |
| 415 | pstatus_t fat_unformat(struct ph_param *params, const struct ph_options *options, alloc_data_t *list_search_space) |
| 416 | { |
| 417 | unsigned int sectors_per_cluster=0; |
| 418 | uint64_t start_data=0; |
| 419 | params->blocksize=0; |
| 420 | if(pfind_sectors_per_cluster(params->disk, params->partition, options->verbose, §ors_per_cluster, &start_data, list_search_space)==0) |
| 421 | { |
| 422 | display_message("Can't find FAT cluster size\n"); |
| 423 | return PSTATUS_OK; |
| 424 | } |
| 425 | if(start_data <= params->partition->part_offset) |
| 426 | { |
| 427 | display_message("FAT filesystem was beginning before the actual partition."); |
| 428 | return PSTATUS_OK; |
| 429 | } |
| 430 | start_data *= params->disk->sector_size; |
| 431 | del_search_space(list_search_space, params->partition->part_offset, start_data - 1); |
| 432 | { |
| 433 | uint64_t offset=start_data; |
| 434 | params->blocksize=sectors_per_cluster * params->disk->sector_size; |
| 435 | #ifdef HAVE_NCURSES |
| 436 | if(options->expert>0) |
| 437 | menu_choose_blocksize(¶ms->blocksize, &offset, params->disk->sector_size); |
| 438 | #endif |
| 439 | update_blocksize(params->blocksize, list_search_space, offset); |
| 440 | } |
| 441 | /* start_data is relative to the disk */ |
| 442 | return fat_unformat_aux(params, options, start_data, list_search_space); |
| 443 | } |
| 444 | #endif |
no test coverage detected