Changeset a93d79a in mainline
- Timestamp:
- 2010-10-19T21:11:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8fb1bf82, e0e568ff
- Parents:
- f14291b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
rf14291b ra93d79a 369 369 unsigned blocks; 370 370 fat_dentry_t *d; 371 dev_handle_t dev_handle; 371 372 block_t *b; 372 373 int rc; 373 374 374 375 fibril_mutex_lock(&parentp->idx->lock); 375 bs = block_bb_get(parentp->idx->dev_handle); 376 dev_handle = parentp->idx->dev_handle; 377 fibril_mutex_unlock(&parentp->idx->lock); 378 379 bs = block_bb_get(dev_handle); 376 380 blocks = parentp->size / BPS(bs); 377 381 for (i = 0; i < blocks; i++) { 378 382 rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE); 379 if (rc != EOK) { 380 fibril_mutex_unlock(&parentp->idx->lock); 383 if (rc != EOK) 381 384 return rc; 382 }383 385 for (j = 0; j < DPS(bs); j++) { 384 386 d = ((fat_dentry_t *)b->data) + j; … … 390 392 /* miss */ 391 393 rc = block_put(b); 392 fibril_mutex_unlock(&parentp->idx->lock);393 394 *rfn = NULL; 394 395 return rc; … … 401 402 /* hit */ 402 403 fat_node_t *nodep; 403 /* 404 * Assume tree hierarchy for locking. We 405 * already have the parent and now we are going 406 * to lock the child. Never lock in the oposite 407 * order. 408 */ 409 fat_idx_t *idx = fat_idx_get_by_pos( 410 parentp->idx->dev_handle, parentp->firstc, 411 i * DPS(bs) + j); 412 fibril_mutex_unlock(&parentp->idx->lock); 404 fat_idx_t *idx = fat_idx_get_by_pos(dev_handle, 405 parentp->firstc, i * DPS(bs) + j); 413 406 if (!idx) { 414 407 /* … … 433 426 } 434 427 rc = block_put(b); 435 if (rc != EOK) { 436 fibril_mutex_unlock(&parentp->idx->lock); 428 if (rc != EOK) 437 429 return rc; 438 } 439 } 440 441 fibril_mutex_unlock(&parentp->idx->lock); 430 } 431 442 432 *rfn = NULL; 443 433 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.