Changes in uspace/srv/fs/fat/fat_idx.c [1e4cada:ca093b3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_idx.c
r1e4cada rca093b3 43 43 #include <adt/list.h> 44 44 #include <assert.h> 45 #include <fibril_sync h.h>45 #include <fibril_sync.h> 46 46 47 47 /** Each instance of this type describes one interval of freed VFS indices. */ … … 339 339 } 340 340 341 static int fat_idx_create(fat_idx_t **fidxp,dev_handle_t dev_handle)341 static fat_idx_t *fat_idx_create(dev_handle_t dev_handle) 342 342 { 343 343 fat_idx_t *fidx; … … 345 345 fidx = (fat_idx_t *) malloc(sizeof(fat_idx_t)); 346 346 if (!fidx) 347 return ENOMEM;347 return NULL; 348 348 if (!fat_index_alloc(dev_handle, &fidx->index)) { 349 349 free(fidx); 350 return ENOSPC;350 return NULL; 351 351 } 352 352 … … 359 359 fidx->nodep = NULL; 360 360 361 *fidxp = fidx; 362 return EOK; 363 } 364 365 int fat_idx_get_new(fat_idx_t **fidxp, dev_handle_t dev_handle) 361 return fidx; 362 } 363 364 fat_idx_t *fat_idx_get_new(dev_handle_t dev_handle) 366 365 { 367 366 fat_idx_t *fidx; 368 int rc;369 367 370 368 fibril_mutex_lock(&used_lock); 371 rc = fat_idx_create(&fidx,dev_handle);372 if ( rc != EOK) {369 fidx = fat_idx_create(dev_handle); 370 if (!fidx) { 373 371 fibril_mutex_unlock(&used_lock); 374 return rc;372 return NULL; 375 373 } 376 374 … … 384 382 fibril_mutex_unlock(&used_lock); 385 383 386 *fidxp = fidx; 387 return EOK; 384 return fidx; 388 385 } 389 386 … … 404 401 fidx = hash_table_get_instance(l, fat_idx_t, uph_link); 405 402 } else { 406 int rc; 407 408 rc = fat_idx_create(&fidx, dev_handle); 409 if (rc != EOK) { 403 fidx = fat_idx_create(dev_handle); 404 if (!fidx) { 410 405 fibril_mutex_unlock(&used_lock); 411 406 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.