Changes in uspace/srv/fs/fat/fat_ops.c [79ae36dd:b72efe8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r79ae36dd rb72efe8 67 67 68 68 /** List of cached free FAT nodes. */ 69 static LIST_INITIALIZE(ffn_ head);69 static LIST_INITIALIZE(ffn_list); 70 70 71 71 /* … … 147 147 static int fat_node_fini_by_devmap_handle(devmap_handle_t devmap_handle) 148 148 { 149 link_t *lnk;150 149 fat_node_t *nodep; 151 150 int rc; … … 159 158 restart: 160 159 fibril_mutex_lock(&ffn_mutex); 161 for (lnk = ffn_head.next; lnk != &ffn_head; lnk = lnk->next) {160 list_foreach(ffn_list, lnk) { 162 161 nodep = list_get_instance(lnk, fat_node_t, ffn_link); 163 162 if (!fibril_mutex_trylock(&nodep->lock)) { … … 196 195 free(nodep); 197 196 198 /* Need to restart because we changed the ffn_headlist. */197 /* Need to restart because we changed ffn_list. */ 199 198 goto restart; 200 199 } … … 211 210 212 211 fibril_mutex_lock(&ffn_mutex); 213 if (!list_empty(&ffn_ head)) {212 if (!list_empty(&ffn_list)) { 214 213 /* Try to use a cached free node structure. */ 215 214 fat_idx_t *idxp_tmp; 216 nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link); 215 nodep = list_get_instance(list_first(&ffn_list), fat_node_t, 216 ffn_link); 217 217 if (!fibril_mutex_trylock(&nodep->lock)) 218 218 goto skip_cache; … … 473 473 if (nodep->idx) { 474 474 fibril_mutex_lock(&ffn_mutex); 475 list_append(&nodep->ffn_link, &ffn_ head);475 list_append(&nodep->ffn_link, &ffn_list); 476 476 fibril_mutex_unlock(&ffn_mutex); 477 477 } else {
Note:
See TracChangeset
for help on using the changeset viewer.