Changeset 67632f7 in mainline
- Timestamp:
- 2013-07-11T20:03:39Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e8f0158
- Parents:
- e6edc8d1
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/df/df.c
re6edc8d1 r67632f7 64 64 mtab_ent->fs_name, 65 65 (long long) st.f_blocks * st.f_bsize, 66 (long long) (st.f_blocks - st.f_bfree) * st.f_bsize, 66 67 (long long) st.f_bfree * st.f_bsize, 67 (long long) (st.f_blocks - st.f_bfree) * st.f_bsize,68 68 (st.f_blocks)?PERCENTAGE(st.f_blocks - st.f_bfree, st.f_blocks):0L, 69 69 mtab_ent->mp); -
uspace/lib/fs/libfs.c
re6edc8d1 r67632f7 864 864 if (NULL != ops->size_block) 865 865 statfs.f_bsize = ops->size_block(service_id); 866 if (NULL != ops->total_block) 867 statfs.f_blocks = ops->total_block(service_id); 868 if (NULL != ops->free_block) 869 statfs.f_bfree = ops->free_block(service_id); 866 870 867 871 ops->node_put(fn); -
uspace/lib/fs/libfs.h
re6edc8d1 r67632f7 94 94 service_id_t (* service_get)(fs_node_t *); 95 95 long (* size_block)(service_id_t); 96 long (* total_block)(service_id_t); 97 long (* free_block)(service_id_t); 96 98 } libfs_ops_t; 97 99 -
uspace/srv/fs/mfs/mfs_ops.c
re6edc8d1 r67632f7 65 65 static bool is_power_of_two(uint32_t n); 66 66 static long mfs_size_block(service_id_t service_id); 67 static long mfs_total_block(service_id_t service_id); 68 static long mfs_free_block(service_id_t service_id); 67 69 68 70 static hash_table_t open_nodes; … … 86 88 .has_children = mfs_has_children, 87 89 .lnkcnt_get = mfs_lnkcnt_get, 88 .size_block = mfs_size_block 90 .size_block = mfs_size_block, 91 .total_block = mfs_total_block, 92 .free_block = mfs_free_block 89 93 }; 90 94 … … 1142 1146 if (NULL == inst) 1143 1147 return ENOENT; 1148 1144 1149 block_size = inst->sbi->block_size; 1150 1145 1151 return block_size; 1152 } 1153 1154 static long 1155 mfs_total_block(service_id_t service_id) 1156 { 1157 long 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 = inst->sbi->nzones; 1168 1169 return block_total; 1170 } 1171 1172 static long 1173 mfs_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 (long)block_free; 1146 1188 } 1147 1189
Note:
See TracChangeset
for help on using the changeset viewer.