Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_idx.c

    r1e4cada rca093b3  
    4343#include <adt/list.h>
    4444#include <assert.h>
    45 #include <fibril_synch.h>
     45#include <fibril_sync.h>
    4646
    4747/** Each instance of this type describes one interval of freed VFS indices. */
     
    339339}
    340340
    341 static int fat_idx_create(fat_idx_t **fidxp, dev_handle_t dev_handle)
     341static fat_idx_t *fat_idx_create(dev_handle_t dev_handle)
    342342{
    343343        fat_idx_t *fidx;
     
    345345        fidx = (fat_idx_t *) malloc(sizeof(fat_idx_t));
    346346        if (!fidx)
    347                 return ENOMEM;
     347                return NULL;
    348348        if (!fat_index_alloc(dev_handle, &fidx->index)) {
    349349                free(fidx);
    350                 return ENOSPC;
     350                return NULL;
    351351        }
    352352               
     
    359359        fidx->nodep = NULL;
    360360
    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
     364fat_idx_t *fat_idx_get_new(dev_handle_t dev_handle)
    366365{
    367366        fat_idx_t *fidx;
    368         int rc;
    369367
    370368        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) {
    373371                fibril_mutex_unlock(&used_lock);
    374                 return rc;
     372                return NULL;
    375373        }
    376374               
     
    384382        fibril_mutex_unlock(&used_lock);
    385383
    386         *fidxp = fidx;
    387         return EOK;
     384        return fidx;
    388385}
    389386
     
    404401                fidx = hash_table_get_instance(l, fat_idx_t, uph_link);
    405402        } 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) {
    410405                        fibril_mutex_unlock(&used_lock);
    411406                        return NULL;
Note: See TracChangeset for help on using the changeset viewer.