Changeset 0d110908 in mainline
- Timestamp:
- 2013-07-22T21:48:09Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 675a2bb
- Parents:
- 17a0fb8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r17a0fb8 r0d110908 93 93 static uint32_t fat_size_block(service_id_t); 94 94 static uint64_t fat_total_block_count(service_id_t); 95 static uint64_t fat_free_block_count(service_id_t); 95 96 96 97 /* … … 863 864 } 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 = 0; 870 uint64_t block_count; 871 int rc; 872 uint32_t fat_no, fat_tot; 873 874 block_count = 0; 875 bs = block_bb_get(service_id); 876 877 fat_tot = (SPC(bs)) ? TS(bs) / SPC(bs) : 0; 878 879 for (fat_no = 0; fat_no < fat_tot; fat_no++) { 880 rc = fat_get_cluster(bs, service_id, FAT1, e0, &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 865 891 /** libfs operations */ 866 892 libfs_ops_t fat_libfs_ops = { … … 882 908 .service_get = fat_service_get, 883 909 .size_block = fat_size_block, 884 .total_block_count = fat_total_block_count 910 .total_block_count = fat_total_block_count, 911 .free_block_count = fat_free_block_count 885 912 }; 886 913
Note:
See TracChangeset
for help on using the changeset viewer.