Changeset 3dd148d in mainline for uspace/srv/fs/fat/fat_ops.c
- Timestamp:
- 2013-07-29T15:15:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 736b07b
- Parents:
- a1c95da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
ra1c95da r3dd148d 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 static int fat_size_block(service_id_t, uint32_t *); 94 static int fat_total_block_count(service_id_t, uint64_t *); 95 static int fat_free_block_count(service_id_t, uint64_t *); 96 96 97 97 /* … … 846 846 } 847 847 848 uint32_t fat_size_block(service_id_t service_id)848 int fat_size_block(service_id_t service_id, uint32_t *size) 849 849 { 850 850 fat_bs_t *bs; 851 851 852 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) 853 *size = BPC(bs); 854 855 return EOK; 856 } 857 858 int fat_total_block_count(service_id_t service_id, uint64_t *count) 857 859 { 858 860 fat_bs_t *bs; 861 859 862 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) 863 *count = (SPC(bs)) ? TS(bs) / SPC(bs) : 0; 864 865 return EOK; 866 } 867 868 int fat_free_block_count(service_id_t service_id, uint64_t *count) 867 869 { 868 870 fat_bs_t *bs; … … 874 876 block_count = 0; 875 877 bs = block_bb_get(service_id); 876 877 878 clusters = (SPC(bs)) ? TS(bs) / SPC(bs) : 0; 878 879 879 for (cluster_no = 0; cluster_no < clusters; cluster_no++) { 880 880 rc = fat_get_cluster(bs, service_id, FAT1, cluster_no, &e0); … … 885 885 block_count++; 886 886 } 887 888 return block_count; 887 *count = block_count; 888 889 return EOK; 889 890 } 890 891
Note:
See TracChangeset
for help on using the changeset viewer.