Index: uspace/lib/ext4/libext4_superblock.c
===================================================================
--- uspace/lib/ext4/libext4_superblock.c	(revision 291af81489fe21d2cfbb74b0e2626f48ab99e915)
+++ uspace/lib/ext4/libext4_superblock.c	(revision 9fc72fb314cf66351b5a63be91b03fb4d04d51ea)
@@ -42,4 +42,9 @@
 #include "libext4.h"
 
+/** Get number of i-nodes in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @return			number of i-nodes
+ */
 uint32_t ext4_superblock_get_inodes_count(ext4_superblock_t *sb)
 {
@@ -47,4 +52,9 @@
 }
 
+/** Set number of i-nodes in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @param count		number of i-nodes
+ */
 void ext4_superblock_set_inodes_count(ext4_superblock_t *sb, uint32_t count)
 {
@@ -52,4 +62,9 @@
 }
 
+/** Get number of data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @return			number of data blocks
+ */
 uint64_t ext4_superblock_get_blocks_count(ext4_superblock_t *sb)
 {
@@ -58,4 +73,9 @@
 }
 
+/** Set number of data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @param count		number of data blocks
+ */
 void ext4_superblock_set_blocks_count(ext4_superblock_t *sb, uint64_t count)
 {
@@ -64,4 +84,9 @@
 }
 
+/** Get number of reserved data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @return			number of reserved data blocks
+ */
 uint64_t ext4_superblock_get_reserved_blocks_count(ext4_superblock_t *sb)
 {
@@ -70,4 +95,9 @@
 }
 
+/** Set number of reserved data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @param count		number of reserved data blocks
+ */
 void ext4_superblock_set_reserved_blocks_count(ext4_superblock_t *sb, uint64_t count)
 {
@@ -76,4 +106,9 @@
 }
 
+/** Get number of free data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @return			number of free data blocks
+ */
 uint64_t ext4_superblock_get_free_blocks_count(ext4_superblock_t *sb)
 {
@@ -82,4 +117,9 @@
 }
 
+/** Set number of free data blocks in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @param count 	number of free data blocks
+ */
 void ext4_superblock_set_free_blocks_count(ext4_superblock_t *sb, uint64_t count)
 {
@@ -88,4 +128,9 @@
 }
 
+/** Get number of free i-nodes in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @return			number of free i-nodes
+ */
 uint32_t ext4_superblock_get_free_inodes_count(ext4_superblock_t *sb)
 {
@@ -93,4 +138,9 @@
 }
 
+/** Set number of free i-nodes in the whole filesystem.
+ *
+ * @param sb		superblock
+ * @param count 	number of free i-nodes
+ */
 void ext4_superblock_set_free_inodes_count(ext4_superblock_t *sb, uint32_t count)
 {
@@ -98,4 +148,9 @@
 }
 
+/** Get index of first data block (block, where is located superblock)
+ *
+ * @param sb		superblock
+ * @return			index of the first data block
+ */
 uint32_t ext4_superblock_get_first_data_block(ext4_superblock_t *sb)
 {
@@ -103,4 +158,9 @@
 }
 
+/** Set index of first data block (block, where is located superblock)
+ *
+ * @param sb		superblock
+ * @param first 	index of the first data block
+ */
 void ext4_superblock_set_first_data_block(ext4_superblock_t *sb, uint32_t first)
 {
@@ -108,4 +168,9 @@
 }
 
+/** Get logarithmic block size (1024 << size == block_size)
+ *
+ * @param sb		superblock
+ * @return			logarithmic block size
+ */
 uint32_t ext4_superblock_get_log_block_size(ext4_superblock_t *sb)
 {
@@ -113,4 +178,9 @@
 }
 
+/** Set logarithmic block size (1024 << size == block_size)
+ *
+ * @param sb		superblock
+ * @return			logarithmic block size
+ */
 void ext4_superblock_set_log_block_size(ext4_superblock_t *sb, uint32_t log_size)
 {
@@ -118,4 +188,9 @@
 }
 
+/** Get size of data block (in bytes).
+ *
+ * @param sb		superblock
+ * @return			size of data block
+ */
 uint32_t ext4_superblock_get_block_size(ext4_superblock_t *sb)
 {
@@ -123,4 +198,9 @@
 }
 
+/** Set size of data block (in bytes).
+ *
+ * @param sb		superblock
+ * @param size		size of data block (must be power of 2, at least 1024)
+ */
 void ext4_superblock_set_block_size(ext4_superblock_t *sb, uint32_t size)
 {
@@ -137,4 +217,9 @@
 }
 
+/** Get number of data blocks per block group (except last BG)
+ *
+ * @param sb		superblock
+ * @return			data blocks per block group
+ */
 uint32_t ext4_superblock_get_blocks_per_group(ext4_superblock_t *sb)
 {
@@ -142,4 +227,9 @@
 }
 
+/** Set number of data blocks per block group (except last BG)
+ *
+ * @param sb		superblock
+ * @param blocks	data blocks per block group
+ */
 void ext4_superblock_set_blocks_per_group(ext4_superblock_t *sb, uint32_t blocks)
 {
@@ -147,4 +237,9 @@
 }
 
+/** Get number of i-nodes per block group (except last BG)
+ *
+ * @param sb		superblock
+ * @return			i-nodes per block group
+ */
 uint32_t ext4_superblock_get_inodes_per_group(ext4_superblock_t *sb)
 {
@@ -152,4 +247,9 @@
 }
 
+/** Set number of i-nodes per block group (except last BG)
+ *
+ * @param sb		superblock
+ * @param inodes	i-nodes per block group
+ */
 void ext4_superblock_set_inodes_per_group(ext4_superblock_t *sb, uint32_t inodes)
 {
@@ -157,4 +257,9 @@
 }
 
+/** Get time when filesystem was mounted (POSIX time).
+ *
+ * @param sb		superblock
+ * @return			mount time
+ */
 uint32_t ext4_superblock_get_mount_time(ext4_superblock_t *sb)
 {
@@ -162,4 +267,9 @@
 }
 
+/** Set time when filesystem was mounted (POSIX time).
+ *
+ * @param sb		superblock
+ * @param time		mount time
+ */
 void ext4_superblock_set_mount_time(ext4_superblock_t *sb, uint32_t time)
 {
@@ -167,4 +277,9 @@
 }
 
+/** Get time when filesystem was last accesed by write operation (POSIX time).
+ *
+ * @param sb		superblock
+ * @return			write time
+ */
 uint32_t ext4_superblock_get_write_time(ext4_superblock_t *sb)
 {
@@ -172,4 +287,9 @@
 }
 
+/** Set time when filesystem was last accesed by write operation (POSIX time).
+ *
+ * @param sb		superblock
+ * @param time		write time
+ */
 void ext4_superblock_set_write_time(ext4_superblock_t *sb, uint32_t time)
 {
@@ -177,4 +297,9 @@
 }
 
+/** Get number of mount from last filesystem check.
+ *
+ * @param sb		superblock
+ * @return			number of mounts
+ */
 uint16_t ext4_superblock_get_mount_count(ext4_superblock_t *sb)
 {
@@ -182,4 +307,9 @@
 }
 
+/** Set number of mount from last filesystem check.
+ *
+ * @param sb		superblock
+ * @param count		number of mounts
+ */
 void ext4_superblock_set_mount_count(ext4_superblock_t *sb, uint16_t count)
 {
@@ -187,4 +317,9 @@
 }
 
+/** Get maximum number of mount from last filesystem check.
+ *
+ * @param sb		superblock
+ * @return			maximum number of mounts
+ */
 uint16_t ext4_superblock_get_max_mount_count(ext4_superblock_t *sb)
 {
@@ -192,4 +327,9 @@
 }
 
+/** Set maximum number of mount from last filesystem check.
+ *
+ * @param sb		superblock
+ * @param count		maximum number of mounts
+ */
 void ext4_superblock_set_max_mount_count(ext4_superblock_t *sb, uint16_t count)
 {
@@ -197,4 +337,9 @@
 }
 
+/** Get superblock magic value.
+ *
+ * @param sb		superblock
+ * @return			magic value
+ */
 uint16_t ext4_superblock_get_magic(ext4_superblock_t *sb)
 {
@@ -202,4 +347,17 @@
 }
 
+/** Set superblock magic value.
+ *
+ * @param sb		superblock
+ * @param			magic value
+ */
+void ext4_superblock_set_magic(ext4_superblock_t *sb, uint16_t magic)
+{
+	sb->magic = host2uint16_t_le(magic);
+}
+
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_state(ext4_superblock_t *sb)
 {
@@ -207,4 +365,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_state(ext4_superblock_t *sb, uint16_t state)
 {
@@ -212,4 +373,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_errors(ext4_superblock_t *sb)
 {
@@ -217,4 +381,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_errors(ext4_superblock_t *sb, uint16_t errors)
 {
@@ -222,4 +389,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_minor_rev_level(ext4_superblock_t *sb)
 {
@@ -227,4 +397,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_minor_rev_level(ext4_superblock_t *sb, uint16_t level)
 {
@@ -232,4 +405,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_last_check_time(ext4_superblock_t *sb)
 {
@@ -237,4 +413,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_last_check_time(ext4_superblock_t *sb, uint32_t time)
 {
@@ -242,8 +421,14 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_check_interval(ext4_superblock_t *sb){
 	return uint32_t_le2host(sb->check_interval);
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_check_interval(ext4_superblock_t *sb, uint32_t interval)
 {
@@ -251,4 +436,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_creator_os(ext4_superblock_t *sb)
 {
@@ -256,4 +444,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_creator_os(ext4_superblock_t *sb, uint32_t os)
 {
@@ -261,4 +452,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *sb)
 {
@@ -266,4 +460,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_rev_level(ext4_superblock_t *sb, uint32_t level)
 {
@@ -271,4 +468,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_def_resuid(ext4_superblock_t *sb)
 {
@@ -276,4 +476,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_def_resuid(ext4_superblock_t *sb, uint16_t uid)
 {
@@ -281,4 +484,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_def_resgid(ext4_superblock_t *sb)
 {
@@ -286,4 +492,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_def_resgid(ext4_superblock_t *sb, uint16_t gid)
 {
@@ -291,4 +500,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_first_inode(ext4_superblock_t *sb)
 {
@@ -296,4 +508,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_first_inode(ext4_superblock_t *sb, uint32_t first_inode)
 {
@@ -301,4 +516,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_inode_size(ext4_superblock_t *sb)
 {
@@ -309,4 +527,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_inode_size(ext4_superblock_t *sb, uint16_t size)
 {
@@ -314,4 +535,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_block_group_number(ext4_superblock_t *sb)
 {
@@ -319,4 +543,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_block_group_number(ext4_superblock_t *sb, uint16_t bg)
 {
@@ -324,4 +551,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_features_compatible(ext4_superblock_t *sb)
 {
@@ -329,4 +559,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_features_compatible(ext4_superblock_t *sb, uint32_t features)
 {
@@ -334,4 +567,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_features_incompatible(ext4_superblock_t *sb)
 {
@@ -339,4 +575,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_features_incompatible(ext4_superblock_t *sb, uint32_t features)
 {
@@ -344,4 +583,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_features_read_only(ext4_superblock_t *sb)
 {
@@ -349,4 +591,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_features_read_only(ext4_superblock_t *sb, uint32_t features)
 {
@@ -354,4 +599,7 @@
 }
 
+/** TODO comment
+ *
+ */
 const uint8_t * ext4_superblock_get_uuid(ext4_superblock_t *sb)
 {
@@ -359,4 +607,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_uuid(ext4_superblock_t *sb, const uint8_t *uuid)
 {
@@ -369,4 +620,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_volume_name(ext4_superblock_t *sb, const char *name)
 {
@@ -374,4 +628,7 @@
 }
 
+/** TODO comment
+ *
+ */
 const char * ext4_superblock_get_last_mounted(ext4_superblock_t *sb)
 {
@@ -379,4 +636,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_last_mounted(ext4_superblock_t *sb, const char *last)
 {
@@ -384,5 +644,7 @@
 }
 
-
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_last_orphan(ext4_superblock_t *sb)
 {
@@ -390,4 +652,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_last_orphan(ext4_superblock_t *sb, uint32_t last_orphan)
 {
@@ -395,4 +660,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t* ext4_superblock_get_hash_seed(ext4_superblock_t *sb)
 {
@@ -400,4 +668,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint8_t ext4_superblock_get_default_hash_version(ext4_superblock_t *sb)
 {
@@ -405,4 +676,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_default_hash_version(ext4_superblock_t *sb, uint8_t version)
 {
@@ -410,4 +684,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint16_t ext4_superblock_get_desc_size(ext4_superblock_t *sb)
 {
@@ -421,4 +698,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_desc_size(ext4_superblock_t *sb, uint16_t size)
 {
@@ -426,4 +706,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_flags(ext4_superblock_t *sb)
 {
@@ -431,4 +714,7 @@
 }
 
+/** TODO comment
+ *
+ */
 void ext4_superblock_set_flags(ext4_superblock_t *sb, uint32_t flags)
 {
@@ -441,4 +727,7 @@
  */
 
+/** TODO comment
+ *
+ */
 bool ext4_superblock_has_flag(ext4_superblock_t *sb, uint32_t flag)
 {
@@ -449,5 +738,7 @@
 }
 
-// Feature checkers
+/** TODO comment
+ *
+ */
 bool ext4_superblock_has_feature_compatible(ext4_superblock_t *sb, uint32_t feature)
 {
@@ -458,4 +749,7 @@
 }
 
+/** TODO comment
+ *
+ */
 bool ext4_superblock_has_feature_incompatible(ext4_superblock_t *sb, uint32_t feature)
 {
@@ -466,4 +760,7 @@
 }
 
+/** TODO comment
+ *
+ */
 bool ext4_superblock_has_feature_read_only(ext4_superblock_t *sb, uint32_t feature)
 {
@@ -474,5 +771,7 @@
 }
 
-
+/** TODO comment
+ *
+ */
 int ext4_superblock_read_direct(service_id_t service_id,
     ext4_superblock_t **superblock)
@@ -498,4 +797,7 @@
 }
 
+/** TODO comment
+ *
+ */
 int ext4_superblock_write_direct(service_id_t service_id,
 		ext4_superblock_t *sb)
@@ -521,5 +823,7 @@
 }
 
-
+/** TODO comment
+ *
+ */
 int ext4_superblock_check_sanity(ext4_superblock_t *sb)
 {
@@ -537,4 +841,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_block_group_count(ext4_superblock_t *sb)
 {
@@ -552,4 +859,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_blocks_in_group(ext4_superblock_t *sb, uint32_t bgid)
 {
@@ -566,4 +876,7 @@
 }
 
+/** TODO comment
+ *
+ */
 uint32_t ext4_superblock_get_inodes_in_group(ext4_superblock_t *sb, uint32_t bgid)
 {
