Changeset 4b4668e in mainline for uspace/srv/fs/fat/fat_ops.c
- Timestamp:
- 2009-09-21T16:00:44Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46c0498
- Parents:
- 4098e38
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r4098e38 r4b4668e 445 445 for (i = 0; i < blocks; i++) { 446 446 rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE); 447 assert(rc == EOK); 447 if (rc != EOK) { 448 fibril_mutex_unlock(&parentp->idx->lock); 449 return rc; 450 } 448 451 for (j = 0; j < dps; j++) { 449 452 d = ((fat_dentry_t *)b->data) + j; … … 460 463 } 461 464 rc = block_put(b); 462 assert(rc == EOK); 465 if (rc != EOK) { 466 fibril_mutex_unlock(&parentp->idx->lock); 467 return rc; 468 } 463 469 } 464 470 j = 0; … … 478 484 } 479 485 rc = fat_zero_cluster(bs, parentp->idx->dev_handle, mcl); 480 assert(rc == EOK); 486 if (rc != EOK) { 487 fibril_mutex_unlock(&parentp->idx->lock); 488 return rc; 489 } 481 490 rc = fat_append_clusters(bs, parentp, mcl); 482 assert(rc == EOK); 491 if (rc != EOK) { 492 fibril_mutex_unlock(&parentp->idx->lock); 493 return rc; 494 } 483 495 parentp->size += bps * bs->spc; 484 496 parentp->dirty = true; /* need to sync node */ 485 497 rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE); 486 assert(rc == EOK); 498 if (rc != EOK) { 499 fibril_mutex_unlock(&parentp->idx->lock); 500 return rc; 501 } 487 502 d = (fat_dentry_t *)b->data; 488 503 … … 498 513 b->dirty = true; /* need to sync block */ 499 514 rc = block_put(b); 500 assert(rc == EOK);501 515 fibril_mutex_unlock(&parentp->idx->lock); 516 if (rc != EOK) 517 return rc; 502 518 503 519 fibril_mutex_lock(&childp->idx->lock); … … 510 526 */ 511 527 rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE); 512 assert(rc == EOK); 528 if (rc != EOK) { 529 /* 530 * Rather than returning an error, simply skip the creation of 531 * these two entries. 532 */ 533 goto skip_dots; 534 } 513 535 d = (fat_dentry_t *)b->data; 514 536 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || … … 534 556 } 535 557 b->dirty = true; /* need to sync block */ 536 rc = block_put(b); 537 assert(rc == EOK); 558 /* 559 * Ignore the return value as we would have fallen through on error 560 * anyway. 561 */ 562 (void) block_put(b); 563 skip_dots: 538 564 539 565 childp->idx->pfc = parentp->firstc;
Note:
See TracChangeset
for help on using the changeset viewer.