Changeset 758f8d5 in mainline for uspace/srv/fs/mfs/mfs_ops.c


Ignore:
Timestamp:
2013-09-11T21:53:36Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e1ec5a2
Parents:
1e371cf (diff), 9dbdda9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge the df branch

File:
1 edited

Legend:

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

    r1e371cf r758f8d5  
    6464static int mfs_check_sanity(struct mfs_sb_info *sbi);
    6565static bool is_power_of_two(uint32_t n);
     66static int mfs_size_block(service_id_t service_id, uint32_t *size);
     67static int mfs_total_block_count(service_id_t service_id, uint64_t *count);
     68static int mfs_free_block_count(service_id_t service_id, uint64_t *count);
    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_count = mfs_total_block_count,
     92        .free_block_count = mfs_free_block_count
    8793};
    8894
     
    11291135}
    11301136
     1137static int
     1138mfs_size_block(service_id_t service_id, uint32_t *size)
     1139{
     1140        struct mfs_instance *inst;
     1141        int rc;
     1142
     1143        rc = mfs_instance_get(service_id, &inst);
     1144        if (rc != EOK)
     1145                return rc;
     1146
     1147        if (NULL == inst)
     1148                return ENOENT;
     1149       
     1150        *size = inst->sbi->block_size;
     1151
     1152        return EOK;
     1153}
     1154
     1155static int
     1156mfs_total_block_count(service_id_t service_id, uint64_t *count)
     1157{
     1158        struct mfs_instance *inst;
     1159        int rc;
     1160       
     1161        rc = mfs_instance_get(service_id, &inst);
     1162        if (rc != EOK)
     1163                return rc;
     1164
     1165        if (NULL == inst)
     1166                return ENOENT;
     1167       
     1168        *count = (uint64_t) MFS_BMAP_SIZE_BITS(inst->sbi, BMAP_ZONE);
     1169
     1170        return EOK;
     1171}
     1172
     1173static int
     1174mfs_free_block_count(service_id_t service_id, uint64_t *count)
     1175{
     1176        uint32_t block_free;
     1177       
     1178        struct mfs_instance *inst;
     1179        int rc = mfs_instance_get(service_id, &inst);
     1180        if (rc != EOK)
     1181                return rc;
     1182
     1183        if (NULL == inst)
     1184                return ENOENT;
     1185
     1186        mfs_count_free_zones(inst, &block_free);
     1187        *count = block_free;
     1188
     1189        return EOK;
     1190}
     1191
    11311192vfs_out_ops_t mfs_ops = {
    11321193        .mounted = mfs_mounted,
Note: See TracChangeset for help on using the changeset viewer.