Changes in uspace/srv/fs/ext4fs/ext4fs_ops.c [feeac0d:3dd148d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext4fs/ext4fs_ops.c
rfeeac0d r3dd148d 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 int ext4fs_size_block(service_id_t, uint32_t *); 104 static int ext4fs_total_block_count(service_id_t, uint64_t *); 105 static int ext4fs_free_block_count(service_id_t, uint64_t *); 103 106 104 107 /* Static variables */ … … 194 197 } 195 198 196 list_foreach(instance_list, link, ext4fs_instance_t, tmp) { 199 list_foreach(instance_list, link) { 200 ext4fs_instance_t *tmp = 201 list_get_instance(link, ext4fs_instance_t, link); 202 197 203 if (tmp->service_id == service_id) { 198 204 *inst = tmp; … … 833 839 ext4fs_node_t *enode = EXT4FS_NODE(fn); 834 840 return enode->instance->service_id; 841 } 842 843 int ext4fs_size_block(service_id_t service_id, uint32_t *size) 844 { 845 ext4fs_instance_t *inst; 846 int rc = ext4fs_instance_get(service_id, &inst); 847 if (rc != EOK) 848 return rc; 849 850 if (NULL == inst) 851 return ENOENT; 852 853 ext4_superblock_t *sb = inst->filesystem->superblock; 854 *size = ext4_superblock_get_block_size(sb); 855 856 return EOK; 857 } 858 859 int ext4fs_total_block_count(service_id_t service_id, uint64_t *count) 860 { 861 ext4fs_instance_t *inst; 862 int rc = ext4fs_instance_get(service_id, &inst); 863 if (rc != EOK) 864 return rc; 865 866 if (NULL == inst) 867 return ENOENT; 868 869 ext4_superblock_t *sb = inst->filesystem->superblock; 870 *count = ext4_superblock_get_blocks_count(sb); 871 872 return EOK; 873 } 874 875 int ext4fs_free_block_count(service_id_t service_id, uint64_t *count) 876 { 877 ext4fs_instance_t *inst; 878 int rc = ext4fs_instance_get(service_id, &inst); 879 if (rc != EOK) 880 return rc; 881 if (NULL == inst) 882 return ENOENT; 883 884 ext4_superblock_t *sb = inst->filesystem->superblock; 885 *count = ext4_superblock_get_free_blocks_count(sb); 886 887 return EOK; 835 888 } 836 889 … … 854 907 .is_directory = ext4fs_is_directory, 855 908 .is_file = ext4fs_is_file, 856 .service_get = ext4fs_service_get 909 .service_get = ext4fs_service_get, 910 .size_block = ext4fs_size_block, 911 .total_block_count = ext4fs_total_block_count, 912 .free_block_count = ext4fs_free_block_count 857 913 }; 858 914
Note:
See TracChangeset
for help on using the changeset viewer.