Changes in uspace/srv/fs/ext4fs/ext4fs_ops.c [d0a1e9b6:d1538a1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext4fs/ext4fs_ops.c
rd0a1e9b6 rd1538a1 101 101 static bool ext4fs_is_file(fs_node_t *node); 102 102 static service_id_t ext4fs_service_get(fs_node_t *node); 103 static uint32_t ext4fs_size_block(service_id_t);104 static uint64_t ext4fs_total_block(service_id_t);105 static uint64_t ext4fs_free_block(service_id_t);106 103 107 104 /* Static variables */ … … 839 836 ext4fs_node_t *enode = EXT4FS_NODE(fn); 840 837 return enode->instance->service_id; 841 }842 843 uint32_t ext4fs_size_block(service_id_t service_id)844 {845 ext4fs_instance_t *inst;846 int rc = ext4fs_instance_get(service_id, &inst);847 if (rc != EOK)848 return rc;849 if (NULL == inst)850 return ENOENT;851 852 ext4_superblock_t *sb = inst->filesystem->superblock;853 uint32_t block_size = ext4_superblock_get_block_size(sb);854 855 return block_size;856 }857 858 uint64_t ext4fs_total_block(service_id_t service_id)859 {860 ext4fs_instance_t *inst;861 int rc = ext4fs_instance_get(service_id, &inst);862 if (rc != EOK)863 return rc;864 if (NULL == inst)865 return ENOENT;866 867 ext4_superblock_t *sb = inst->filesystem->superblock;868 uint64_t block_count = ext4_superblock_get_blocks_count(sb);869 870 return block_count;871 }872 873 uint64_t ext4fs_free_block(service_id_t service_id)874 {875 ext4fs_instance_t *inst;876 int rc = ext4fs_instance_get(service_id, &inst);877 if (rc != EOK)878 return rc;879 if (NULL == inst)880 return ENOENT;881 882 ext4_superblock_t *sb = inst->filesystem->superblock;883 uint64_t block_count = ext4_superblock_get_free_blocks_count(sb);884 885 return block_count;886 838 } 887 839 … … 905 857 .is_directory = ext4fs_is_directory, 906 858 .is_file = ext4fs_is_file, 907 .service_get = ext4fs_service_get, 908 .size_block = ext4fs_size_block, 909 .total_block = ext4fs_total_block, 910 .free_block = ext4fs_free_block 859 .service_get = ext4fs_service_get 911 860 }; 912 861
Note:
See TracChangeset
for help on using the changeset viewer.