Changeset 758f8d5 in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c


Ignore:
Timestamp:
2013-09-11T21:53:36Z (12 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/ext4fs/ext4fs_ops.c

    r1e371cf r758f8d5  
    101101static bool ext4fs_is_file(fs_node_t *node);
    102102static service_id_t ext4fs_service_get(fs_node_t *node);
     103static int ext4fs_size_block(service_id_t, uint32_t *);
     104static int ext4fs_total_block_count(service_id_t, uint64_t *);
     105static int ext4fs_free_block_count(service_id_t, uint64_t *);
    103106
    104107/* Static variables */
     
    833836        ext4fs_node_t *enode = EXT4FS_NODE(fn);
    834837        return enode->instance->service_id;
     838}
     839
     840int ext4fs_size_block(service_id_t service_id, uint32_t *size)
     841{
     842        ext4fs_instance_t *inst;
     843        int rc = ext4fs_instance_get(service_id, &inst);
     844        if (rc != EOK)
     845                return rc;
     846
     847        if (NULL == inst)
     848                return ENOENT;
     849
     850        ext4_superblock_t *sb = inst->filesystem->superblock;
     851        *size = ext4_superblock_get_block_size(sb);
     852
     853        return EOK;
     854}
     855
     856int ext4fs_total_block_count(service_id_t service_id, uint64_t *count)
     857{
     858        ext4fs_instance_t *inst;
     859        int rc = ext4fs_instance_get(service_id, &inst);
     860        if (rc != EOK)
     861                return rc;
     862
     863        if (NULL == inst)
     864                return ENOENT;
     865
     866        ext4_superblock_t *sb = inst->filesystem->superblock;
     867        *count = ext4_superblock_get_blocks_count(sb);
     868
     869        return EOK;
     870}
     871
     872int ext4fs_free_block_count(service_id_t service_id, uint64_t *count)
     873{
     874        ext4fs_instance_t *inst;
     875        int rc = ext4fs_instance_get(service_id, &inst);
     876        if (rc != EOK)
     877                return rc;
     878        if (NULL == inst)
     879                return ENOENT;
     880
     881        ext4_superblock_t *sb = inst->filesystem->superblock;
     882        *count = ext4_superblock_get_free_blocks_count(sb);
     883
     884        return EOK;
    835885}
    836886
     
    854904        .is_directory = ext4fs_is_directory,
    855905        .is_file = ext4fs_is_file,
    856         .service_get = ext4fs_service_get
     906        .service_get = ext4fs_service_get,
     907        .size_block = ext4fs_size_block,
     908        .total_block_count = ext4fs_total_block_count,
     909        .free_block_count = ext4fs_free_block_count
    857910};
    858911
Note: See TracChangeset for help on using the changeset viewer.