Changes in uspace/srv/fs/exfat/exfat_fat.c [aaa77ba0:0dbe5ac] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_fat.c
raaa77ba0 r0dbe5ac 50 50 #include <malloc.h> 51 51 #include <mem.h> 52 #include <str.h>53 52 54 53 … … 127 126 { 128 127 exfat_cluster_t firstc = nodep->firstc; 129 exfat_cluster_t currc = 0;128 exfat_cluster_t currc; 130 129 aoff64_t relbn = bn; 131 130 int rc; … … 314 313 clst++) { 315 314 /* Need to rewrite because of multiple exfat_bitmap_get calls */ 316 if ( exfat_bitmap_is_free(bs, service_id, clst) == EOK) {315 if (bitmap_is_free(bs, service_id, clst) == EOK) { 317 316 /* 318 317 * The cluster is free. Put it into our stack … … 323 322 (found == 0) ? EXFAT_CLST_EOF : lifo[found - 1]); 324 323 if (rc != EOK) 325 goto exit_error;324 break; 326 325 found++; 327 rc = exfat_bitmap_set_cluster(bs, service_id, clst);326 rc = bitmap_set_cluster(bs, service_id, clst); 328 327 if (rc != EOK) 329 goto exit_error;328 break; 330 329 331 330 } … … 340 339 } 341 340 342 rc = ENOSPC;343 344 exit_error:345 346 341 /* If something wrong - free the clusters */ 347 342 while (found--) { 348 (void) exfat_bitmap_clear_cluster(bs, service_id, lifo[found]);343 (void) bitmap_clear_cluster(bs, service_id, lifo[found]); 349 344 (void) exfat_set_cluster(bs, service_id, lifo[found], 0); 350 345 } … … 352 347 free(lifo); 353 348 fibril_mutex_unlock(&exfat_alloc_lock); 354 return rc;349 return ENOSPC; 355 350 } 356 351 … … 378 373 if (rc != EOK) 379 374 return rc; 380 rc = exfat_bitmap_clear_cluster(bs, service_id, firstc);375 rc = bitmap_clear_cluster(bs, service_id, firstc); 381 376 if (rc != EOK) 382 377 return rc; … … 542 537 int exfat_sanity_check(exfat_bs_t *bs, service_id_t service_id) 543 538 { 544 if (str_cmp((char const *)bs->oem_name, "EXFAT ")) 545 return ENOTSUP; 546 else if (uint16_t_le2host(bs->signature) != 0xAA55) 547 return ENOTSUP; 548 else if (uint32_t_le2host(bs->fat_sector_count) == 0) 549 return ENOTSUP; 550 else if (uint32_t_le2host(bs->data_clusters) == 0) 551 return ENOTSUP; 552 else if (bs->fat_count != 1) 553 return ENOTSUP; 554 else if ((bs->bytes_per_sector + bs->sec_per_cluster) > 25) { 555 /* exFAT does not support cluster size > 32 Mb */ 556 return ENOTSUP; 557 } 539 /* TODO */ 558 540 return EOK; 559 541 }
Note:
See TracChangeset
for help on using the changeset viewer.