Changeset 1b20da0 in mainline for uspace/srv/fs/fat/fat_idx.c
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_idx.c
rdf6ded8 r1b20da0 29 29 /** @addtogroup fs 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** … … 92 92 93 93 list_foreach(unused_list, link, unused_t, u) { 94 if (u->service_id == service_id) 94 if (u->service_id == service_id) 95 95 return u; 96 96 } … … 108 108 * The index structures are hashed by the service_id, parent node's first 109 109 * cluster and index within the parent directory. 110 */ 110 */ 111 111 static hash_table_t up_hash; 112 112 … … 211 211 u = unused_find(service_id, true); 212 212 if (!u) 213 return false; 213 return false; 214 214 215 215 if (list_empty(&u->freed_list)) { 216 if (u->remaining) { 216 if (u->remaining) { 217 217 /* 218 218 * There are no freed indices, allocate one directly … … 333 333 334 334 fidx = (fat_idx_t *) malloc(sizeof(fat_idx_t)); 335 if (!fidx) 335 if (!fidx) 336 336 return ENOMEM; 337 337 if (!fat_index_alloc(service_id, &fidx->index)) { … … 469 469 errno_t fat_idx_init(void) 470 470 { 471 if (!hash_table_create(&up_hash, 0, 0, &uph_ops)) 471 if (!hash_table_create(&up_hash, 0, 0, &uph_ops)) 472 472 return ENOMEM; 473 473 if (!hash_table_create(&ui_hash, 0, 0, &uih_ops)) { … … 535 535 * Remove this instance's index structure from up_hash and ui_hash. 536 536 * Process up_hash first and ui_hash second because the index structure 537 * is actually removed in idx_remove_callback(). 537 * is actually removed in idx_remove_callback(). 538 538 */ 539 539 fibril_mutex_lock(&used_lock); … … 556 556 free(f); 557 557 } 558 free(u); 558 free(u); 559 559 } 560 560 561 561 /** 562 562 * @} 563 */ 563 */
Note:
See TracChangeset
for help on using the changeset viewer.