Changeset 87159eb8 in mainline for uspace/srv/fs/exfat/exfat_ops.c


Ignore:
Timestamp:
2013-07-13T17:09:02Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b86a32e
Parents:
a727fb0
Message:

Add get total and free block operation for exfat.
Note: allocated_percent doesn't work.

File:
1 edited

Legend:

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

    ra727fb0 r87159eb8  
    9090static service_id_t exfat_service_get(fs_node_t *node);
    9191static uint32_t exfat_size_block(service_id_t);
     92static uint64_t exfat_total_block(service_id_t);
     93static uint64_t exfat_free_block(service_id_t);
    9294
    9395/*
     
    921923}
    922924
     925uint64_t exfat_total_block(service_id_t service_id)
     926{
     927        exfat_bs_t *bs;
     928        bs = block_bb_get(service_id);
     929       
     930        uint64_t block_count = DATA_CNT(bs);
     931       
     932        return block_count;
     933}
     934
     935uint64_t exfat_free_block(service_id_t service_id)
     936{
     937        exfat_bs_t *bs;
     938        bs = block_bb_get(service_id);
     939       
     940        uint64_t block_count = (DATA_CNT(bs) / 100) *
     941                        bs->allocated_percent;
     942
     943        return block_count;
     944}
     945
    923946/** libfs operations */
    924947libfs_ops_t exfat_libfs_ops = {
     
    939962        .is_file = exfat_is_file,
    940963        .service_get = exfat_service_get,
    941         .size_block = exfat_size_block
     964        .size_block = exfat_size_block,
     965        .total_block = exfat_total_block,
     966        .free_block = exfat_free_block
    942967};
    943968
Note: See TracChangeset for help on using the changeset viewer.