Changeset 3dd148d in mainline for uspace/srv/fs/exfat/exfat_ops.c


Ignore:
Timestamp:
2013-07-29T15:15:49Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
736b07b
Parents:
a1c95da
Message:

Change stafs function operation to allow correct error handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_ops.c

    ra1c95da r3dd148d  
    8989static bool exfat_is_file(fs_node_t *node);
    9090static service_id_t exfat_service_get(fs_node_t *node);
    91 static uint32_t exfat_size_block(service_id_t);
    92 static uint64_t exfat_total_block_count(service_id_t);
    93 static uint64_t exfat_free_block_count(service_id_t);
     91static int exfat_size_block(service_id_t, uint32_t *);
     92static int exfat_total_block_count(service_id_t, uint64_t *);
     93static int exfat_free_block_count(service_id_t, uint64_t *);
    9494
    9595/*
     
    915915}
    916916
    917 uint32_t exfat_size_block(service_id_t service_id)
     917int exfat_size_block(service_id_t service_id, uint32_t *size)
    918918{
    919919        exfat_bs_t *bs;
    920920        bs = block_bb_get(service_id);
    921        
    922         return BPC(bs);
    923 }
    924 
    925 uint64_t exfat_total_block_count(service_id_t service_id)
     921        *size = BPC(bs);
     922
     923        return EOK;
     924}
     925
     926int exfat_total_block_count(service_id_t service_id, uint64_t *count)
    926927{
    927928        exfat_bs_t *bs;
    928929        bs = block_bb_get(service_id);
     930        *count = DATA_CNT(bs);
    929931       
    930         uint64_t block_count = DATA_CNT(bs);
    931        
    932         return block_count;
    933 }
    934 
    935 uint64_t exfat_free_block_count(service_id_t service_id)
     932        return EOK;
     933}
     934
     935int exfat_free_block_count(service_id_t service_id, uint64_t *count)
    936936{
    937937        fs_node_t *node;
     
    943943        int rc;
    944944
    945         block_count = exfat_total_block_count(service_id);
     945        rc = exfat_total_block_count(service_id, &block_count);
     946        if (rc != EOK)
     947                goto exit;
    946948
    947949        bs = block_bb_get(service_id);
     
    985987exit:
    986988        exfat_node_put(node);
    987         return free_block_count;
     989        *count = free_block_count;
     990        return rc;
    988991}
    989992
Note: See TracChangeset for help on using the changeset viewer.