Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/mfs/mfs_ops.c

    r1ba6651 rd0a1e9b6  
    6464static int mfs_check_sanity(struct mfs_sb_info *sbi);
    6565static bool is_power_of_two(uint32_t n);
     66static uint32_t mfs_size_block(service_id_t service_id);
     67static uint64_t mfs_total_block(service_id_t service_id);
     68static uint64_t mfs_free_block(service_id_t service_id);
    6669
    6770static hash_table_t open_nodes;
     
    8487        .destroy = mfs_destroy_node,
    8588        .has_children = mfs_has_children,
    86         .lnkcnt_get = mfs_lnkcnt_get
     89        .lnkcnt_get = mfs_lnkcnt_get,
     90        .size_block = mfs_size_block,
     91        .total_block = mfs_total_block,
     92        .free_block = mfs_free_block
    8793};
    8894
     
    11291135}
    11301136
     1137static uint32_t
     1138mfs_size_block(service_id_t service_id)
     1139{
     1140        uint32_t block_size;
     1141
     1142        struct mfs_instance *inst;
     1143        int rc = mfs_instance_get(service_id, &inst);
     1144        if (rc != EOK)
     1145                return rc;
     1146        if (NULL == inst)
     1147                return ENOENT;
     1148       
     1149        block_size = inst->sbi->block_size;
     1150
     1151        return block_size;
     1152}
     1153
     1154static uint64_t
     1155mfs_total_block(service_id_t service_id)
     1156{
     1157        uint64_t block_total;
     1158       
     1159        struct mfs_instance *inst;
     1160        int rc = mfs_instance_get(service_id, &inst);
     1161        if (rc != EOK)
     1162                return rc;
     1163
     1164        if (NULL == inst)
     1165                return ENOENT;
     1166       
     1167        block_total = (uint64_t)inst->sbi->nzones;
     1168
     1169        return block_total;
     1170}
     1171
     1172static uint64_t
     1173mfs_free_block(service_id_t service_id)
     1174{
     1175        uint32_t block_free;
     1176       
     1177        struct mfs_instance *inst;
     1178        int rc = mfs_instance_get(service_id, &inst);
     1179        if (rc != EOK)
     1180                return rc;
     1181
     1182        if (NULL == inst)
     1183                return ENOENT;
     1184
     1185        mfs_count_free_zones(inst, &block_free);
     1186
     1187        return (uint64_t)block_free;
     1188}
     1189
    11311190vfs_out_ops_t mfs_ops = {
    11321191        .mounted = mfs_mounted,
Note: See TracChangeset for help on using the changeset viewer.