Changes in uspace/srv/fs/fat/fat_ops.c [44ecf89:5cd6c84] in mainline
- File:
-
- 1 edited
-
uspace/srv/fs/fat/fat_ops.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r44ecf89 r5cd6c84 91 91 static bool fat_is_file(fs_node_t *node); 92 92 static service_id_t fat_service_get(fs_node_t *node); 93 static uint32_t fat_size_block(service_id_t); 94 static uint64_t fat_total_block_count(service_id_t); 95 static uint64_t fat_free_block_count(service_id_t); 93 96 94 97 /* … … 843 846 } 844 847 848 uint32_t fat_size_block(service_id_t service_id) 849 { 850 fat_bs_t *bs; 851 bs = block_bb_get(service_id); 852 853 return BPC(bs); 854 } 855 856 uint64_t fat_total_block_count(service_id_t service_id) 857 { 858 fat_bs_t *bs; 859 bs = block_bb_get(service_id); 860 861 uint64_t block_count = (SPC(bs)) ? TS(bs) / SPC(bs) : 0; 862 863 return block_count; 864 } 865 866 uint64_t fat_free_block_count(service_id_t service_id) 867 { 868 fat_bs_t *bs; 869 fat_cluster_t e0; 870 uint64_t block_count; 871 int rc; 872 uint32_t cluster_no, clusters; 873 874 block_count = 0; 875 bs = block_bb_get(service_id); 876 877 clusters = (SPC(bs)) ? TS(bs) / SPC(bs) : 0; 878 879 for (cluster_no = 0; cluster_no < clusters; cluster_no++) { 880 rc = fat_get_cluster(bs, service_id, FAT1, cluster_no, &e0); 881 if (rc != EOK) 882 return EIO; 883 884 if (e0 == FAT_CLST_RES0) 885 block_count++; 886 } 887 888 return block_count; 889 } 890 845 891 /** libfs operations */ 846 892 libfs_ops_t fat_libfs_ops = { … … 860 906 .is_directory = fat_is_directory, 861 907 .is_file = fat_is_file, 862 .service_get = fat_service_get 908 .service_get = fat_service_get, 909 .size_block = fat_size_block, 910 .total_block_count = fat_total_block_count, 911 .free_block_count = fat_free_block_count 863 912 }; 864 913
Note:
See TracChangeset
for help on using the changeset viewer.
