Index: uspace/lib/ext4/libext4_bitmap.c
===================================================================
--- uspace/lib/ext4/libext4_bitmap.c	(revision 4358513e5caa034eb15b20401d83004c9418add9)
+++ uspace/lib/ext4/libext4_bitmap.c	(revision 7b16549a8defb8f5617b928b2068286e2f2249f8)
@@ -41,4 +41,11 @@
 #include "libext4.h"
 
+/** Set bit in bitmap to 0 (free).
+ *
+ * Index must be checked by caller, if it's not out of bounds.
+ *
+ * @param bitmap	pointer to bitmap
+ * @param index		index of bit in bitmap
+ */
 void ext4_bitmap_free_bit(uint8_t *bitmap, uint32_t index)
 {
@@ -51,4 +58,12 @@
 }
 
+/** Free continous set of bits (set to 0).
+ *
+ * Index and count must be checked by caller, if they aren't out of bounds.
+ *
+ * @param bitmap	pointer to bitmap
+ * @param index		index of first bit to zeroed
+ * @param count		number of bits to be zeroed
+ */
 void ext4_bitmap_free_bits(uint8_t *bitmap, uint32_t index, uint32_t count)
 {
@@ -58,4 +73,5 @@
 	uint32_t byte_index;
 
+	// Align index to multiple of 8
 	while (((idx % 8) != 0) && (remaining > 0)) {
 
@@ -71,4 +87,5 @@
 	}
 
+	// For < 8 bits this check necessary
 	if (remaining == 0) {
 		return;
@@ -80,4 +97,5 @@
 	target = bitmap + byte_index;
 
+	// Zero the whole bytes
 	while (remaining >= 8) {
 		*target = 0;
@@ -90,4 +108,5 @@
 	assert(remaining < 8);
 
+	// Zero remaining bytes
 	while (remaining != 0) {
 
@@ -104,4 +123,9 @@
 }
 
+/** Set bit in bitmap to 1 (used).
+ *
+ * @param bitmap	pointer to bitmap
+ * @param index		index of bit to set
+ */
 void ext4_bitmap_set_bit(uint8_t *bitmap, uint32_t index)
 {
@@ -114,4 +138,10 @@
 }
 
+/** Check if requested bit is free.
+ *
+ * @param bitmap	pointer to bitmap
+ * @param index		index of bit to be checked
+ * @return			true if bit is free, else false
+ */
 bool ext4_bitmap_is_free_bit(uint8_t *bitmap, uint32_t index)
 {
@@ -129,7 +159,20 @@
 }
 
+/**	Try to find free byte and set the first bit as used.
+ *
+ * Walk through bitmap and try to find free byte ( == 0).
+ * If byte found, set the first bit as used.
+ *
+ * @param bitmap	pointer to bitmap
+ * @param start		index of bit, where the algorithm will begin
+ * @param index		output value - index of bit (if found free byte)
+ * @param max		maximum index of bit in bitmap
+ * @return			error code
+ */
 int ext4_bitmap_find_free_byte_and_set_bit(uint8_t *bitmap, uint32_t start, uint32_t *index, uint32_t max)
 {
 	uint32_t idx;
+
+	// Align idx
 	if (start % 8) {
 		idx = start + (8 - (start % 8));
@@ -140,4 +183,5 @@
 	uint8_t *pos = bitmap + (idx / 8);
 
+	// Try to find free byte
 	while (idx < max) {
 
@@ -153,7 +197,18 @@
 	}
 
+	// Free byte not found
 	return ENOSPC;
 }
 
+/** Try to find free bit and set it as used (1).
+ *
+ * Walk through bitmap and try to find any free bit.
+ *
+ * @param bitmap	pointer to bitmap
+ * @param start_idx	index of bit, where algorithm will begin
+ * @param index		output value - index of set bit (if found)
+ * @param max		maximum index of bit in bitmap
+ * @return			error code
+ */
 int ext4_bitmap_find_free_bit_and_set(uint8_t *bitmap, uint32_t start_idx,
 		uint32_t *index, uint32_t max)
@@ -163,5 +218,5 @@
 	bool byte_part = false;
 
-	// Check the rest of byte
+	// Check the rest of first byte
 	while ((idx % 8) != 0) {
 		byte_part = true;
@@ -180,4 +235,5 @@
 	}
 
+	// Check the whole bytes (255 = 11111111 binary)
 	while (idx < max) {
 
@@ -191,6 +247,8 @@
 	}
 
-
+	// If idx < max, some free bit found
 	if (idx < max) {
+
+		// Check which bit from byte is free
 		for (uint8_t i = 0; i < 8; ++i) {
 			if ((*pos & (1 << i)) == 0) {
@@ -204,4 +262,5 @@
 	}
 
+	// Free bit not found
 	return ENOSPC;
 }
