Changeset 4452366 in mainline
- Timestamp:
- 2008-05-16T21:03:46Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 78a1b7b
- Parents:
- 1a60fee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_idx.c
r1a60fee r4452366 69 69 } unused_t; 70 70 71 /** Futex protecting the list of unused structures. */ 72 static futex_t unused_futex = FUTEX_INITIALIZER; 73 74 /** List of unused structures. */ 71 75 static LIST_INITIALIZE(unused_head); 72 76 … … 188 192 189 193 assert(index); 194 futex_down(&unused_futex); 190 195 for (l = unused_head.next; l != &unused_head; l = l->next) { 191 196 u = list_get_instance(l, unused_t, link); … … 193 198 goto hit; 194 199 } 195 200 futex_up(&unused_futex); 201 196 202 /* dev_handle not found */ 197 203 return false; … … 206 212 *index = u->next++; 207 213 --u->remaining; 214 futex_up(&unused_futex); 208 215 return true; 209 216 } … … 218 225 free(f); 219 226 } 227 futex_up(&unused_futex); 220 228 return true; 221 229 } … … 225 233 * too many zero-sized nodes). 226 234 */ 235 futex_up(&unused_futex); 227 236 return false; 228 237 } … … 253 262 unused_t *u; 254 263 264 futex_down(&unused_futex); 255 265 for (l = unused_head.next; l != &unused_head; l = l->next) { 256 266 u = list_get_instance(l, unused_t, link); … … 258 268 goto hit; 259 269 } 270 futex_up(&unused_futex); 260 271 261 272 /* should not happen */ … … 267 278 u->next--; 268 279 u->remaining++; 269 return;270 280 } else { 271 281 /* … … 283 293 try_coalesce_intervals(lnk->prev, lnk, 284 294 lnk); 295 futex_up(&unused_futex); 285 296 return; 286 297 } … … 290 301 try_coalesce_intervals(lnk, lnk->next, 291 302 lnk); 303 futex_up(&unused_futex); 292 304 return; 293 305 } … … 300 312 n->last = index; 301 313 list_insert_before(&n->link, lnk); 314 futex_up(&unused_futex); 302 315 return; 303 316 } … … 313 326 list_append(&n->link, &u->freed_head); 314 327 } 328 futex_up(&unused_futex); 315 329 } 316 330
Note:
See TracChangeset
for help on using the changeset viewer.