Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 17a0fb873315b20c3609cd6ea608820e982625ea)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 0d11090869b9d246a0a2d99eb43cacbfe69d6a11)
@@ -93,4 +93,5 @@
 static uint32_t fat_size_block(service_id_t);
 static uint64_t fat_total_block_count(service_id_t);
+static uint64_t fat_free_block_count(service_id_t);
 
 /*
@@ -863,4 +864,29 @@
 }
 
+uint64_t fat_free_block_count(service_id_t service_id)
+{
+	fat_bs_t *bs;
+	fat_cluster_t e0 = 0;
+	uint64_t block_count;
+	int rc;
+	uint32_t fat_no, fat_tot;
+
+	block_count = 0;
+	bs = block_bb_get(service_id);
+	
+	fat_tot = (SPC(bs)) ? TS(bs) / SPC(bs) : 0;
+	
+	for (fat_no = 0; fat_no < fat_tot; fat_no++) {
+		rc = fat_get_cluster(bs, service_id, FAT1, e0, &e0);
+		if (rc != EOK)
+			return EIO;
+
+		if (e0 == FAT_CLST_RES0)
+			block_count++;
+	}
+
+	return block_count;
+}
+
 /** libfs operations */
 libfs_ops_t fat_libfs_ops = {
@@ -882,5 +908,6 @@
 	.service_get = fat_service_get,
 	.size_block = fat_size_block,
-	.total_block_count = fat_total_block_count
+	.total_block_count = fat_total_block_count,
+	.free_block_count = fat_free_block_count
 };
 
