Changes in uspace/srv/fs/mfs/mfs_ops.c [1ba6651:3dd148d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/mfs/mfs_ops.c
r1ba6651 r3dd148d 64 64 static int mfs_check_sanity(struct mfs_sb_info *sbi); 65 65 static bool is_power_of_two(uint32_t n); 66 static int mfs_size_block(service_id_t service_id, uint32_t *size); 67 static int mfs_total_block_count(service_id_t service_id, uint64_t *count); 68 static int mfs_free_block_count(service_id_t service_id, uint64_t *count); 66 69 67 70 static hash_table_t open_nodes; … … 84 87 .destroy = mfs_destroy_node, 85 88 .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 87 93 }; 88 94 … … 1129 1135 } 1130 1136 1137 static int 1138 mfs_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 1155 static int 1156 mfs_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 1173 static int 1174 mfs_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 1131 1192 vfs_out_ops_t mfs_ops = { 1132 1193 .mounted = mfs_mounted,
Note:
See TracChangeset
for help on using the changeset viewer.