Changeset b85c19a in mainline
- Timestamp:
- 2011-06-20T18:52:36Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 563686b
- Parents:
- c6aca755
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
rc6aca755 rb85c19a 391 391 /* hit */ 392 392 fat_node_t *nodep; 393 aoff64_t o = (di.pos-1)% (BPS(di.bs) / sizeof(fat_dentry_t));393 aoff64_t o = di.pos % (BPS(di.bs) / sizeof(fat_dentry_t)); 394 394 fat_idx_t *idx = fat_idx_get_by_pos(devmap_handle, 395 395 parentp->firstc, di.bnum * DPS(di.bs) + o); … … 413 413 (void) fat_node_put(*rfn); 414 414 return rc; 415 } else { 416 rc = fat_directory_next(&di); 417 if (rc != EOK) 418 break; 415 419 } 416 420 } … … 757 761 fat_node_t *parentp = FAT_NODE(pfn); 758 762 fat_node_t *childp = FAT_NODE(cfn); 759 fat_bs_t *bs;760 fat_dentry_t *d;761 block_t *b;762 763 bool has_children; 763 764 int rc; … … 776 777 assert(childp->lnkcnt == 1); 777 778 fibril_mutex_lock(&childp->idx->lock); 778 bs = block_bb_get(childp->idx->devmap_handle); 779 780 rc = _fat_block_get(&b, bs, childp->idx->devmap_handle, childp->idx->pfc, 781 NULL, (childp->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 782 BLOCK_FLAGS_NONE); 779 780 fat_directory_t di; 781 rc = fat_directory_open(parentp,&di); 783 782 if (rc != EOK) 784 783 goto error; 785 d = (fat_dentry_t *)b->data + 786 (childp->idx->pdi % (BPS(bs) / sizeof(fat_dentry_t))); 787 /* mark the dentry as not-currently-used */ 788 d->name[0] = FAT_DENTRY_ERASED; 789 b->dirty = true; /* need to sync block */ 790 rc = block_put(b); 784 rc = fat_directory_seek(&di, childp->idx->pdi); 785 if (rc != EOK) 786 goto error; 787 rc = fat_directory_erase(&di); 788 if (rc != EOK) 789 goto error; 790 rc = fat_directory_close(&di); 791 791 if (rc != EOK) 792 792 goto error; … … 807 807 808 808 error: 809 fibril_mutex_unlock(&parentp->idx->lock); 809 (void) fat_directory_close(&di); 810 fibril_mutex_unlock(&childp->idx->lock); 810 811 fibril_mutex_unlock(&childp->lock); 811 fibril_mutex_unlock(& childp->idx->lock);812 fibril_mutex_unlock(&parentp->lock); 812 813 return rc; 813 814 } … … 1232 1233 goto err; 1233 1234 (void) async_data_read_finalize(callid, name, str_size(name) + 1); 1234 bytes = (pos - spos) ;1235 bytes = (pos - spos)+1; 1235 1236 } 1236 1237
Note:
See TracChangeset
for help on using the changeset viewer.