Index: uspace/lib/ext4/libext4_superblock.c
===================================================================
--- uspace/lib/ext4/libext4_superblock.c	(revision fe61181fa59a4e6299307c453129da8aa2539451)
+++ uspace/lib/ext4/libext4_superblock.c	(revision 6c34f587dc553bfe599e1e96d19701a9d33eddf4)
@@ -29,9 +29,9 @@
 /** @addtogroup libext4
  * @{
- */ 
+ */
 
 /**
- * @file	libext4_superblock.c
- * @brief	Ext4 superblock operations.
+ * @file  libext4_superblock.c
+ * @brief Ext4 superblock operations.
  */
 
@@ -44,6 +44,8 @@
 /** Get number of i-nodes in the whole filesystem.
  *
- * @param sb		superblock
- * @return			number of i-nodes
+ * @param sb Superblock
+ *
+ * @return Number of i-nodes
+ *
  */
 uint32_t ext4_superblock_get_inodes_count(ext4_superblock_t *sb)
@@ -54,6 +56,7 @@
 /** Set number of i-nodes in the whole filesystem.
  *
- * @param sb		superblock
- * @param count		number of i-nodes
+ * @param sb    Superblock
+ * @param count Number of i-nodes
+ *
  */
 void ext4_superblock_set_inodes_count(ext4_superblock_t *sb, uint32_t count)
@@ -64,17 +67,20 @@
 /** Get number of data blocks in the whole filesystem.
  *
- * @param sb		superblock
- * @return			number of data blocks
+ * @param sb Superblock
+ *
+ * @return Number of data blocks
+ *
  */
 uint64_t ext4_superblock_get_blocks_count(ext4_superblock_t *sb)
 {
-	return ((uint64_t)uint32_t_le2host(sb->blocks_count_hi) << 32) |
-			uint32_t_le2host(sb->blocks_count_lo);
+	return ((uint64_t) uint32_t_le2host(sb->blocks_count_hi) << 32) |
+	    uint32_t_le2host(sb->blocks_count_lo);
 }
 
 /** Set number of data blocks in the whole filesystem.
  *
- * @param sb		superblock
- * @param count		number of data blocks
+ * @param sb    Superblock
+ * @param count Number of data blocks
+ *
  */
 void ext4_superblock_set_blocks_count(ext4_superblock_t *sb, uint64_t count)
@@ -86,19 +92,24 @@
 /** Get number of reserved data blocks in the whole filesystem.
  *
- * @param sb		superblock
- * @return			number of reserved data blocks
+ * @param sb Superblock
+ *
+ * @return Number of reserved data blocks
+ *
  */
 uint64_t ext4_superblock_get_reserved_blocks_count(ext4_superblock_t *sb)
 {
-	return ((uint64_t)uint32_t_le2host(sb->reserved_blocks_count_hi) << 32) |
-			uint32_t_le2host(sb->reserved_blocks_count_lo);
+	return ((uint64_t)
+	    uint32_t_le2host(sb->reserved_blocks_count_hi) << 32) |
+	    uint32_t_le2host(sb->reserved_blocks_count_lo);
 }
 
 /** 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)
+ * @param sb    Superblock
+ * @param count Number of reserved data blocks
+ *
+ */
+void ext4_superblock_set_reserved_blocks_count(ext4_superblock_t *sb,
+    uint64_t count)
 {
 	sb->reserved_blocks_count_lo = host2uint32_t_le((count << 32) >> 32);
@@ -108,19 +119,24 @@
 /** Get number of free data blocks in the whole filesystem.
  *
- * @param sb		superblock
- * @return			number of free data blocks
+ * @param sb Superblock
+ *
+ * @return Number of free data blocks
+ *
  */
 uint64_t ext4_superblock_get_free_blocks_count(ext4_superblock_t *sb)
 {
-	return ((uint64_t)uint32_t_le2host(sb->free_blocks_count_hi) << 32) |
-			uint32_t_le2host(sb->free_blocks_count_lo);
+	return ((uint64_t)
+	    uint32_t_le2host(sb->free_blocks_count_hi) << 32) |
+	    uint32_t_le2host(sb->free_blocks_count_lo);
 }
 
 /** 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)
+ * @param sb    Superblock
+ * @param count Number of free data blocks
+ *
+ */
+void ext4_superblock_set_free_blocks_count(ext4_superblock_t *sb,
+    uint64_t count)
 {
 	sb->free_blocks_count_lo = host2uint32_t_le((count << 32) >> 32);
@@ -130,6 +146,8 @@
 /** Get number of free i-nodes in the whole filesystem.
  *
- * @param sb		superblock
- * @return			number of free i-nodes
+ * @param sb Superblock
+ *
+ * @return Number of free i-nodes
+ *
  */
 uint32_t ext4_superblock_get_free_inodes_count(ext4_superblock_t *sb)
@@ -140,16 +158,20 @@
 /** 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)
+ * @param sb    Superblock
+ * @param count Number of free i-nodes
+ *
+ */
+void ext4_superblock_set_free_inodes_count(ext4_superblock_t *sb,
+    uint32_t count)
 {
 	sb->free_inodes_count = host2uint32_t_le(count);
 }
 
-/** Get index of first data block (block, where is located superblock)
- *
- * @param sb		superblock
- * @return			index of the first data block
+/** Get index of first data block (block where the superblock is located)
+ *
+ * @param sb Superblock
+ *
+ * @return Index of the first data block
+ *
  */
 uint32_t ext4_superblock_get_first_data_block(ext4_superblock_t *sb)
@@ -158,10 +180,12 @@
 }
 
-/** 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)
+/** Set index of first data block (block where the superblock is located)
+ *
+ * @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)
 {
 	sb->first_data_block = host2uint32_t_le(first);
@@ -170,6 +194,8 @@
 /** Get logarithmic block size (1024 << size == block_size)
  *
- * @param sb		superblock
- * @return			logarithmic block size
+ * @param sb Superblock
+ *
+ * @return Logarithmic block size
+ *
  */
 uint32_t ext4_superblock_get_log_block_size(ext4_superblock_t *sb)
@@ -180,8 +206,11 @@
 /** 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)
+ * @param sb Superblock
+ *
+ * @return Logarithmic block size
+ *
+ */
+void ext4_superblock_set_log_block_size(ext4_superblock_t *sb,
+    uint32_t log_size)
 {
 	sb->log_block_size = host2uint32_t_le(log_size);
@@ -190,6 +219,8 @@
 /** Get size of data block (in bytes).
  *
- * @param sb		superblock
- * @return			size of data block
+ * @param sb Superblock
+ *
+ * @return Size of data block
+ *
  */
 uint32_t ext4_superblock_get_block_size(ext4_superblock_t *sb)
@@ -200,6 +231,7 @@
 /** Set size of data block (in bytes).
  *
- * @param sb		superblock
- * @param size		size of data block (must be power of 2, at least 1024)
+ * @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)
@@ -207,5 +239,5 @@
 	uint32_t log = 0;
 	uint32_t tmp = size / EXT4_MIN_BLOCK_SIZE;
-
+	
 	tmp >>= 1;
 	while (tmp) {
@@ -213,5 +245,5 @@
 		tmp >>= 1;
 	}
-
+	
 	ext4_superblock_set_log_block_size(sb, log);
 }
@@ -219,6 +251,8 @@
 /** Get logarithmic fragment size (1024 << size)
  *
- * @param sb		superblock
- * @return			logarithmic fragment size
+ * @param sb Superblock
+ *
+ * @return Logarithmic fragment size
+ *
  */
 uint32_t ext4_superblock_get_log_frag_size(ext4_superblock_t *sb)
@@ -229,9 +263,10 @@
 /** Set logarithmic fragment size (1024 << size)
  *
- * @param sb		superblock
- * @return			logarithmic fragment size
- */
-
-void ext4_superblock_set_log_frag_size(ext4_superblock_t *sb, uint32_t frag_size)
+ * @param sb        Superblock
+ * @param frag_size Logarithmic fragment size
+ *
+ */
+void ext4_superblock_set_log_frag_size(ext4_superblock_t *sb,
+    uint32_t frag_size)
 {
 	sb->log_frag_size = host2uint32_t_le(frag_size);
@@ -240,6 +275,8 @@
 /** Get size of fragment (in bytes).
  *
- * @param sb		superblock
- * @return			size of fragment
+ * @param sb Superblock
+ *
+ * @return Size of fragment
+ *
  */
 uint32_t ext4_superblock_get_frag_size(ext4_superblock_t *sb)
@@ -250,6 +287,7 @@
 /** Set size of fragment (in bytes).
  *
- * @param sb		superblock
- * @param size		size of fragment (must be power of 2, at least 1024)
+ * @param sb   Superblock
+ * @param size Size of fragment (must be power of 2, at least 1024)
+ *
  */
 void ext4_superblock_set_frag_size(ext4_superblock_t *sb, uint32_t size)
@@ -257,5 +295,5 @@
 	uint32_t log = 0;
 	uint32_t tmp = size / EXT4_MIN_BLOCK_SIZE;
-
+	
 	tmp >>= 1;
 	while (tmp) {
@@ -263,5 +301,5 @@
 		tmp >>= 1;
 	}
-
+	
 	ext4_superblock_set_log_frag_size(sb, log);
 }
@@ -269,6 +307,8 @@
 /** Get number of data blocks per block group (except last BG)
  *
- * @param sb		superblock
- * @return			data blocks per block group
+ * @param sb Superblock
+ *
+ * @return Data blocks per block group
+ *
  */
 uint32_t ext4_superblock_get_blocks_per_group(ext4_superblock_t *sb)
@@ -279,8 +319,10 @@
 /** 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)
+ * @param sb     Superblock
+ * @param blocks Data blocks per block group
+ *
+ */
+void ext4_superblock_set_blocks_per_group(ext4_superblock_t *sb,
+    uint32_t blocks)
 {
 	sb->blocks_per_group = host2uint32_t_le(blocks);
@@ -289,6 +331,8 @@
 /** Get number of fragments per block group (except last BG)
  *
- * @param sb		superblock
- * @return			fragments per block group
+ * @param sb Superblock
+ *
+ * @return Fragments per block group
+ *
  */
 uint32_t ext4_superblock_get_frags_per_group(ext4_superblock_t *sb)
@@ -299,6 +343,6 @@
 /** Set number of fragment per block group (except last BG)
  *
- * @param sb		superblock
- * @param frags		fragments per block group
+ * @param sb    Superblock
+ * @param frags Fragments per block group
  */
 void ext4_superblock_set_frags_per_group(ext4_superblock_t *sb, uint32_t frags)
@@ -307,9 +351,10 @@
 }
 
-
 /** Get number of i-nodes per block group (except last BG)
  *
- * @param sb		superblock
- * @return			i-nodes per block group
+ * @param sb Superblock
+ *
+ * @return I-nodes per block group
+ *
  */
 uint32_t ext4_superblock_get_inodes_per_group(ext4_superblock_t *sb)
@@ -320,8 +365,10 @@
 /** 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)
+ * @param sb     Superblock
+ * @param inodes I-nodes per block group
+ *
+ */
+void ext4_superblock_set_inodes_per_group(ext4_superblock_t *sb,
+    uint32_t inodes)
 {
 	sb->inodes_per_group = host2uint32_t_le(inodes);
@@ -330,6 +377,8 @@
 /** Get time when filesystem was mounted (POSIX time).
  *
- * @param sb		superblock
- * @return			mount time
+ * @param sb Superblock
+ *
+ * @return Mount time
+ *
  */
 uint32_t ext4_superblock_get_mount_time(ext4_superblock_t *sb)
@@ -340,6 +389,7 @@
 /** Set time when filesystem was mounted (POSIX time).
  *
- * @param sb		superblock
- * @param time		mount time
+ * @param sb   Superblock
+ * @param time Mount time
+ *
  */
 void ext4_superblock_set_mount_time(ext4_superblock_t *sb, uint32_t time)
@@ -350,6 +400,8 @@
 /** Get time when filesystem was last accesed by write operation (POSIX time).
  *
- * @param sb		superblock
- * @return			write time
+ * @param sb Superblock
+ *
+ * @return Write time
+ *
  */
 uint32_t ext4_superblock_get_write_time(ext4_superblock_t *sb)
@@ -360,6 +412,7 @@
 /** Set time when filesystem was last accesed by write operation (POSIX time).
  *
- * @param sb		superblock
- * @param time		write time
+ * @param sb   Superblock
+ * @param time Write time
+ *
  */
 void ext4_superblock_set_write_time(ext4_superblock_t *sb, uint32_t time)
@@ -370,6 +423,8 @@
 /** Get number of mount from last filesystem check.
  *
- * @param sb		superblock
- * @return			number of mounts
+ * @param sb Superblock
+ *
+ * @return Number of mounts
+ *
  */
 uint16_t ext4_superblock_get_mount_count(ext4_superblock_t *sb)
@@ -380,6 +435,7 @@
 /** Set number of mount from last filesystem check.
  *
- * @param sb		superblock
- * @param count		number of mounts
+ * @param sb    Superblock
+ * @param count Number of mounts
+ *
  */
 void ext4_superblock_set_mount_count(ext4_superblock_t *sb, uint16_t count)
@@ -390,6 +446,8 @@
 /** Get maximum number of mount from last filesystem check.
  *
- * @param sb		superblock
- * @return			maximum number of mounts
+ * @param sb Superblock
+ *
+ * @return Maximum number of mounts
+ *
  */
 uint16_t ext4_superblock_get_max_mount_count(ext4_superblock_t *sb)
@@ -400,6 +458,7 @@
 /** Set maximum number of mount from last filesystem check.
  *
- * @param sb		superblock
- * @param count		maximum number of mounts
+ * @param sb    Superblock
+ * @param count Maximum number of mounts
+ *
  */
 void ext4_superblock_set_max_mount_count(ext4_superblock_t *sb, uint16_t count)
@@ -410,6 +469,8 @@
 /** Get superblock magic value.
  *
- * @param sb		superblock
- * @return			magic value
+ * @param sb Superblock
+ *
+ * @return Magic value
+ *
  */
 uint16_t ext4_superblock_get_magic(ext4_superblock_t *sb)
@@ -420,6 +481,7 @@
 /** Set superblock magic value.
  *
- * @param sb		superblock
- * @param			magic value
+ * @param sb    Superblock
+ * @param magic Magic value
+ *
  */
 void ext4_superblock_set_magic(ext4_superblock_t *sb, uint16_t magic)
@@ -430,6 +492,8 @@
 /** Get filesystem state.
  *
- * @param sb		superblock
- * @return			filesystem state
+ * @param sb Superblock
+ *
+ * @return Filesystem state
+ *
  */
 uint16_t ext4_superblock_get_state(ext4_superblock_t *sb)
@@ -440,6 +504,7 @@
 /** Set filesystem state.
  *
- * @param sb		superblock
- * @param state		filesystem state
+ * @param sb    Superblock
+ * @param state Filesystem state
+ *
  */
 void ext4_superblock_set_state(ext4_superblock_t *sb, uint16_t state)
@@ -450,6 +515,8 @@
 /** Get behavior code when errors detected.
  *
- * @param sb		superblock
- * @return			behavior code
+ * @param sb Superblock
+ *
+ * @return Behavior code
+ *
  */
 uint16_t ext4_superblock_get_errors(ext4_superblock_t *sb)
@@ -460,6 +527,7 @@
 /** Set behavior code when errors detected.
  *
- * @param sb		superblock
- * @param errors 	behavior code
+ * @param sb     Superblock
+ * @param errors Behavior code
+ *
  */
 void ext4_superblock_set_errors(ext4_superblock_t *sb, uint16_t errors)
@@ -470,6 +538,8 @@
 /** Get minor revision level of the filesystem.
  *
- * @param sb		superblock
- * @return			minor revision level
+ * @param sb Superblock
+ *
+ * @return Minor revision level
+ *
  */
 uint16_t ext4_superblock_get_minor_rev_level(ext4_superblock_t *sb)
@@ -480,6 +550,7 @@
 /** Set minor revision level of the filesystem.
  *
- * @param sb		superblock
- * @param level 	minor revision level
+ * @param sb    Superblock
+ * @param level Minor revision level
+ *
  */
 void ext4_superblock_set_minor_rev_level(ext4_superblock_t *sb, uint16_t level)
@@ -490,6 +561,8 @@
 /** Get time of the last filesystem check.
  *
- * @param sb		superblock
- * @return			time of the last check (POSIX)
+ * @param sb Superblock
+ *
+ * @return Time of the last check (POSIX)
+ *
  */
 uint32_t ext4_superblock_get_last_check_time(ext4_superblock_t *sb)
@@ -500,6 +573,7 @@
 /** Set time of the last filesystem check.
  *
- * @param sb		superblock
- * @param time		time of the last check (POSIX)
+ * @param sb   Superblock
+ * @param time Time of the last check (POSIX)
+ *
  */
 void ext4_superblock_set_last_check_time(ext4_superblock_t *sb, uint32_t time)
@@ -510,8 +584,11 @@
 /** Get maximum time interval between two filesystem checks.
  *
- * @param sb		superblock
- * @return			time interval between two check (POSIX)
- */
-uint32_t ext4_superblock_get_check_interval(ext4_superblock_t *sb){
+ * @param sb Superblock
+ *
+ * @return Time interval between two check (POSIX)
+ *
+ */
+uint32_t ext4_superblock_get_check_interval(ext4_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->check_interval);
 }
@@ -519,6 +596,7 @@
 /** Set maximum time interval between two filesystem checks.
  *
- * @param sb			superblock
- * @param interval		time interval between two check (POSIX)
+ * @param sb       Superblock
+ * @param interval Time interval between two check (POSIX)
+ *
  */
 void ext4_superblock_set_check_interval(ext4_superblock_t *sb, uint32_t interval)
@@ -529,6 +607,8 @@
 /** Get operation system identifier, on which the filesystem was created.
  *
- * @param sb		superblock
- * @return			operation system identifier
+ * @param sb Superblock
+ *
+ * @return Operation system identifier
+ *
  */
 uint32_t ext4_superblock_get_creator_os(ext4_superblock_t *sb)
@@ -539,6 +619,7 @@
 /** Set operation system identifier, on which the filesystem was created.
  *
- * @param sb		superblock
- * @param os		operation system identifier
+ * @param sb Superblock
+ * @param os Operation system identifier
+ *
  */
 void ext4_superblock_set_creator_os(ext4_superblock_t *sb, uint32_t os)
@@ -549,6 +630,8 @@
 /** Get revision level of the filesystem.
  *
- * @param sb		superblock
- * @return			revision level
+ * @param sb Superblock
+ *
+ * @return Revision level
+ *
  */
 uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *sb)
@@ -559,6 +642,7 @@
 /** Set revision level of the filesystem.
  *
- * @param sb		superblock
- * @param level 	revision level
+ * @param sb    Superblock
+ * @param level Revision level
+ *
  */
 void ext4_superblock_set_rev_level(ext4_superblock_t *sb, uint32_t level)
@@ -569,6 +653,8 @@
 /** Get default user id for reserved blocks.
  *
- * @param sb		superblock
- * @return			default user id for reserved blocks.
+ * @param sb Superblock
+ *
+ * @return Default user id for reserved blocks.
+ *
  */
 uint16_t ext4_superblock_get_def_resuid(ext4_superblock_t *sb)
@@ -579,6 +665,7 @@
 /** Set default user id for reserved blocks.
  *
- * @param sb		superblock
- * @param uid		default user id for reserved blocks.
+ * @param sb  Superblock
+ * @param uid Default user id for reserved blocks.
+ *
  */
 void ext4_superblock_set_def_resuid(ext4_superblock_t *sb, uint16_t uid)
@@ -589,6 +676,8 @@
 /** Get default group id for reserved blocks.
  *
- * @param sb		superblock
- * @return			default group id for reserved blocks.
+ * @param sb Superblock
+ *
+ * @return Default group id for reserved blocks.
+ *
  */
 uint16_t ext4_superblock_get_def_resgid(ext4_superblock_t *sb)
@@ -599,6 +688,7 @@
 /** Set default group id for reserved blocks.
  *
- * @param sb		superblock
- * @param gid		default group id for reserved blocks.
+ * @param sb  Superblock
+ * @param gid Default group id for reserved blocks.
+ *
  */
 void ext4_superblock_set_def_resgid(ext4_superblock_t *sb, uint16_t gid)
@@ -609,6 +699,8 @@
 /** Get index of the first i-node, which can be used for allocation.
  *
- * @param sb		superblock
- * @return			i-node index
+ * @param sb Superblock
+ *
+ * @return I-node index
+ *
  */
 uint32_t ext4_superblock_get_first_inode(ext4_superblock_t *sb)
@@ -619,8 +711,10 @@
 /** Set index of the first i-node, which can be used for allocation.
  *
- * @param sb			superblock
- * @param first_inode	i-node index
- */
-void ext4_superblock_set_first_inode(ext4_superblock_t *sb, uint32_t first_inode)
+ * @param sb          Superblock
+ * @param first_inode I-node index
+ *
+ */
+void ext4_superblock_set_first_inode(ext4_superblock_t *sb,
+    uint32_t first_inode)
 {
 	sb->first_inode = host2uint32_t_le(first_inode);
@@ -631,12 +725,14 @@
  * For the oldest revision return constant number.
  *
- * @param sb			superblock
- * @return				size of i-node structure
+ * @param sb Superblock
+ *
+ * @return Size of i-node structure
+ *
  */
 uint16_t ext4_superblock_get_inode_size(ext4_superblock_t *sb)
 {
-	if (ext4_superblock_get_rev_level(sb) == 0) {
+	if (ext4_superblock_get_rev_level(sb) == 0)
 		return EXT4_REV0_INODE_SIZE;
-	}
+	
 	return uint16_t_le2host(sb->inode_size);
 }
@@ -644,6 +740,7 @@
 /** Set size of i-node structure.
  *
- * @param sb			superblock
- * @param size			size of i-node structure
+ * @param sb   Superblock
+ * @param size Size of i-node structure
+ *
  */
 void ext4_superblock_set_inode_size(ext4_superblock_t *sb, uint16_t size)
@@ -654,6 +751,8 @@
 /** Get index of block group, where superblock copy is located.
  *
- * @param sb			superblock
- * @return				block group index
+ * @param sb Superblock
+ *
+ * @return Block group index
+ *
  */
 uint16_t ext4_superblock_get_block_group_index(ext4_superblock_t *sb)
@@ -664,6 +763,7 @@
 /** Set index of block group, where superblock copy is located.
  *
- * @param sb			superblock
- * @param bgid			block group index
+ * @param sb   Superblock
+ * @param bgid Block group index
+ *
  */
 void ext4_superblock_set_block_group_index(ext4_superblock_t *sb, uint16_t bgid)
@@ -674,6 +774,8 @@
 /** Get compatible features supported by the filesystem.
  *
- * @param sb		superblock
- * @return			compatible features bitmap
+ * @param sb Superblock
+ *
+ * @return Compatible features bitmap
+ *
  */
 uint32_t ext4_superblock_get_features_compatible(ext4_superblock_t *sb)
@@ -684,8 +786,10 @@
 /** Set compatible features supported by the filesystem.
  *
- * @param sb			superblock
- * @param features		compatible features bitmap
- */
-void ext4_superblock_set_features_compatible(ext4_superblock_t *sb, uint32_t features)
+ * @param sb       Superblock
+ * @param features Compatible features bitmap
+ *
+ */
+void ext4_superblock_set_features_compatible(ext4_superblock_t *sb,
+    uint32_t features)
 {
 	sb->features_compatible = host2uint32_t_le(features);
@@ -694,6 +798,8 @@
 /** Get incompatible features supported by the filesystem.
  *
- * @param sb		superblock
- * @return			incompatible features bitmap
+ * @param sb Superblock
+ *
+ * @return Incompatible features bitmap
+ *
  */
 uint32_t ext4_superblock_get_features_incompatible(ext4_superblock_t *sb)
@@ -704,8 +810,10 @@
 /** Set incompatible features supported by the filesystem.
  *
- * @param sb			superblock
- * @param features		incompatible features bitmap
- */
-void ext4_superblock_set_features_incompatible(ext4_superblock_t *sb, uint32_t features)
+ * @param sb       Superblock
+ * @param features Incompatible features bitmap
+ *
+ */
+void ext4_superblock_set_features_incompatible(ext4_superblock_t *sb,
+    uint32_t features)
 {
 	sb->features_incompatible = host2uint32_t_le(features);
@@ -714,6 +822,8 @@
 /** Get compatible features supported by the filesystem.
  *
- * @param sb		superblock
- * @return			read-only compatible features bitmap
+ * @param sb Superblock
+ *
+ * @return Read-only compatible features bitmap
+ *
  */
 uint32_t ext4_superblock_get_features_read_only(ext4_superblock_t *sb)
@@ -724,8 +834,10 @@
 /** Set compatible features supported by the filesystem.
  *
- * @param sb			superblock
- * @param feature		read-only compatible features bitmap
- */
-void ext4_superblock_set_features_read_only(ext4_superblock_t *sb, uint32_t features)
+ * @param sb      Superblock
+ * @param feature Read-only compatible features bitmap
+ *
+ */
+void ext4_superblock_set_features_read_only(ext4_superblock_t *sb,
+    uint32_t features)
 {
 	sb->features_read_only = host2uint32_t_le(features);
@@ -734,8 +846,10 @@
 /** Get UUID of the filesystem.
  *
- * @param sb		superblock
- * @return 			pointer to UUID array
- */
-const uint8_t * ext4_superblock_get_uuid(ext4_superblock_t *sb)
+ * @param sb superblock
+ *
+ * @return Pointer to UUID array
+ *
+ */
+const uint8_t *ext4_superblock_get_uuid(ext4_superblock_t *sb)
 {
 	return sb->uuid;
@@ -744,6 +858,7 @@
 /** Set UUID of the filesystem.
  *
- * @param sb		superblock
- * @param uuid		pointer to UUID array
+ * @param sb   Superblock
+ * @param uuid Pointer to UUID array
+ *
  */
 void ext4_superblock_set_uuid(ext4_superblock_t *sb, const uint8_t *uuid)
@@ -754,8 +869,10 @@
 /** Get name of the filesystem volume.
  *
- * @param sb		superblock
- * @return			name of the volume
- */
-const char * ext4_superblock_get_volume_name(ext4_superblock_t *sb)
+ * @param sb Superblock
+ *
+ * @return Name of the volume
+ *
+ */
+const char *ext4_superblock_get_volume_name(ext4_superblock_t *sb)
 {
 	return sb->volume_name;
@@ -764,6 +881,6 @@
 /** Set name of the filesystem volume.
  *
- * @param sb		superblock
- * @param name		new name of the volume
+ * @param sb   Superblock
+ * @param name New name of the volume
  */
 void ext4_superblock_set_volume_name(ext4_superblock_t *sb, const char *name)
@@ -774,8 +891,10 @@
 /** Get name of the directory, where this filesystem was mounted at last.
  *
- * @param sb		superblock
- * @return 			directory name
- */
-const char * ext4_superblock_get_last_mounted(ext4_superblock_t *sb)
+ * @param sb Superblock
+ *
+ * @return Directory name
+ *
+ */
+const char *ext4_superblock_get_last_mounted(ext4_superblock_t *sb)
 {
 	return sb->last_mounted;
@@ -784,6 +903,7 @@
 /** Set name of the directory, where this filesystem was mounted at last.
  *
- * @param sb		superblock
- * @param last		directory name
+ * @param sb   Superblock
+ * @param last Directory name
+ *
  */
 void ext4_superblock_set_last_mounted(ext4_superblock_t *sb, const char *last)
@@ -796,6 +916,8 @@
  * Orphans are stored in linked list.
  *
- * @param sb		superblock
- * @return			last orphaned i-node index
+ * @param sb Superblock
+ *
+ * @return Last orphaned i-node index
+ *
  */
 uint32_t ext4_superblock_get_last_orphan(ext4_superblock_t *sb)
@@ -808,8 +930,10 @@
  * Orphans are stored in linked list.
  *
- * @param sb			superblock
- * @param last_orphan	last orphaned i-node index
- */
-void ext4_superblock_set_last_orphan(ext4_superblock_t *sb, uint32_t last_orphan)
+ * @param sb          Superblock
+ * @param last_orphan Last orphaned i-node index
+ *
+ */
+void ext4_superblock_set_last_orphan(ext4_superblock_t *sb,
+    uint32_t last_orphan)
 {
 	sb->last_orphan = host2uint32_t_le(last_orphan);
@@ -818,8 +942,10 @@
 /** Get hash seed for directory index hash function.
  *
- * @param sb		superblock
- * @return			hash seed pointer
- */
-const uint32_t * ext4_superblock_get_hash_seed(ext4_superblock_t *sb)
+ * @param sb Superblock
+ *
+ * @return Hash seed pointer
+ *
+ */
+const uint32_t *ext4_superblock_get_hash_seed(ext4_superblock_t *sb)
 {
 	return sb->hash_seed;
@@ -828,6 +954,7 @@
 /** Set hash seed for directory index hash function.
  *
- * @param sb		superblock
- * @param seed		hash seed pointer
+ * @param sb   Superblock
+ * @param seed Hash seed pointer
+ *
  */
 void ext4_superblock_set_hash_seed(ext4_superblock_t *sb, const uint32_t *seed)
@@ -838,6 +965,8 @@
 /** Get default version of the hash algorithm version for directory index.
  *
- * @param sb		superblock
- * @return			default hash version
+ * @param sb Superblock
+ *
+ * @return Default hash version
+ *
  */
 uint8_t ext4_superblock_get_default_hash_version(ext4_superblock_t *sb)
@@ -848,8 +977,10 @@
 /** Set default version of the hash algorithm version for directory index.
  *
- * @param sb		superblock
- * @param version	default hash version
- */
-void ext4_superblock_set_default_hash_version(ext4_superblock_t *sb, uint8_t version)
+ * @param sb      Superblock
+ * @param version Default hash version
+ *
+ */
+void ext4_superblock_set_default_hash_version(ext4_superblock_t *sb,
+    uint8_t version)
 {
 	sb->default_hash_version = version;
@@ -860,15 +991,16 @@
  * Output value is checked for minimal size.
  *
- * @param sb		superblock
- * @return			size of block group descriptor
+ * @param sb Superblock
+ *
+ * @return Size of block group descriptor
+ *
  */
 uint16_t ext4_superblock_get_desc_size(ext4_superblock_t *sb)
 {
 	uint16_t size = uint16_t_le2host(sb->desc_size);
-
-	if (size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE) {
+	
+	if (size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
 		size = EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE;
-	}
-
+	
 	return size;
 }
@@ -878,13 +1010,14 @@
  * Input value is checked for minimal size.
  *
- * @param sb		superblock
- * @param size 		size of block group descriptor
+ * @param sb   Superblock
+ * @param size Size of block group descriptor
+ *
  */
 void ext4_superblock_set_desc_size(ext4_superblock_t *sb, uint16_t size)
 {
-	if (size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE) {
-		sb->desc_size = host2uint16_t_le(EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE);
-	}
-
+	if (size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
+		sb->desc_size =
+		    host2uint16_t_le(EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE);
+	
 	sb->desc_size = host2uint16_t_le(size);
 }
@@ -892,6 +1025,8 @@
 /** Get superblock flags.
  *
- * @param sb		superblock
- * @return 			flags from the superblock
+ * @param sb Superblock
+ *
+ * @return Flags from the superblock
+ *
  */
 uint32_t ext4_superblock_get_flags(ext4_superblock_t *sb)
@@ -902,6 +1037,7 @@
 /** Set superblock flags.
  *
- * @param sb		superblock
- * @param flags		flags for the superblock
+ * @param sb    Superblock
+ * @param flags Flags for the superblock
+ *
  */
 void ext4_superblock_set_flags(ext4_superblock_t *sb, uint32_t flags)
@@ -916,13 +1052,15 @@
 /** Check if superblock has specified flag.
  *
- * @param sb			superblock
- * @param flag			flag to be checked
- * @return				true, if superblock has the flag
+ * @param sb   Superblock
+ * @param flag Flag to be checked
+ *
+ * @return True, if superblock has the flag
+ *
  */
 bool ext4_superblock_has_flag(ext4_superblock_t *sb, uint32_t flag)
 {
-	if (ext4_superblock_get_flags(sb) & flag) {
+	if (ext4_superblock_get_flags(sb) & flag)
 		return true;
-	}
+	
 	return false;
 }
@@ -930,13 +1068,16 @@
 /** Check if filesystem supports compatible feature.
  *
- * @param sb			superblock
- * @param feature		feature to be checked
- * @return				true, if filesystem supports the feature
- */
-bool ext4_superblock_has_feature_compatible(ext4_superblock_t *sb, uint32_t feature)
-{
-	if (ext4_superblock_get_features_compatible(sb) & feature) {
+ * @param sb      Superblock
+ * @param feature Feature to be checked
+ *
+ * @return True, if filesystem supports the feature
+ *
+ */
+bool ext4_superblock_has_feature_compatible(ext4_superblock_t *sb,
+    uint32_t feature)
+{
+	if (ext4_superblock_get_features_compatible(sb) & feature)
 		return true;
-	}
+	
 	return false;
 }
@@ -944,13 +1085,16 @@
 /** Check if filesystem supports incompatible feature.
  *
- * @param sb			superblock
- * @param feature		feature to be checked
- * @return				true, if filesystem supports the feature
- */
-bool ext4_superblock_has_feature_incompatible(ext4_superblock_t *sb, uint32_t feature)
-{
-	if (ext4_superblock_get_features_incompatible(sb) & feature) {
+ * @param sb      Superblock
+ * @param feature Feature to be checked
+ *
+ * @return True, if filesystem supports the feature
+ *
+ */
+bool ext4_superblock_has_feature_incompatible(ext4_superblock_t *sb,
+    uint32_t feature)
+{
+	if (ext4_superblock_get_features_incompatible(sb) & feature)
 		return true;
-	}
+	
 	return false;
 }
@@ -958,13 +1102,16 @@
 /** Check if filesystem supports read-only compatible feature.
  *
- * @param sb			superblock
- * @param feature		feature to be checked
- * @return				true, if filesystem supports the feature
- */
-bool ext4_superblock_has_feature_read_only(ext4_superblock_t *sb, uint32_t feature)
-{
-	if (ext4_superblock_get_features_read_only(sb) & feature) {
+ * @param sb      Superblock
+ * @param feature Feature to be checked
+ *
+ * @return True, if filesystem supports the feature
+ *
+ */
+bool ext4_superblock_has_feature_read_only(ext4_superblock_t *sb,
+    uint32_t feature)
+{
+	if (ext4_superblock_get_features_read_only(sb) & feature)
 		return true;
-	}
+	
 	return false;
 }
@@ -972,31 +1119,29 @@
 /** Read superblock directly from block device.
  *
- * @param service_id		block device identifier
- * @param sb				output pointer to memory structure
- * @return					error code.
- */
-int ext4_superblock_read_direct(service_id_t service_id,
-    ext4_superblock_t **sb)
-{
-	int rc;
-
+ * @param service_id Block device identifier
+ * @param sb         Output pointer to memory structure
+ *
+ * @return Eerror code.
+ *
+ */
+int ext4_superblock_read_direct(service_id_t service_id, ext4_superblock_t **sb)
+{
 	/* Allocated memory for superblock structure */
 	void *data = malloc(EXT4_SUPERBLOCK_SIZE);
-	if (data == NULL) {
+	if (data == NULL)
 		return ENOMEM;
-	}
-
+	
 	/* Read data from block device */
-	rc = block_read_bytes_direct(service_id, EXT4_SUPERBLOCK_OFFSET,
+	int rc = block_read_bytes_direct(service_id, EXT4_SUPERBLOCK_OFFSET,
 	    EXT4_SUPERBLOCK_SIZE, data);
-
+	
 	if (rc != EOK) {
 		free(data);
 		return rc;
 	}
-
+	
 	/* Set output value */
 	(*sb) = data;
-
+	
 	return EOK;
 }
@@ -1004,33 +1149,30 @@
 /** Write superblock structure directly to block device.
  *
- * @param service_id		block device identifier
- * @param sb				superblock to be written
- * @return					error code
- */
-int ext4_superblock_write_direct(service_id_t service_id,
-		ext4_superblock_t *sb)
-{
-	int rc;
+ * @param service_id Block device identifier
+ * @param sb         Superblock to be written
+ *
+ * @return Error code
+ *
+ */
+int ext4_superblock_write_direct(service_id_t service_id, ext4_superblock_t *sb)
+{
+	/* Load physical block size from block device */
 	size_t phys_block_size;
-
-	/* Load physical block size from block device */
-	rc = block_get_bsize(service_id, &phys_block_size);
-	if (rc != EOK) {
+	int rc = block_get_bsize(service_id, &phys_block_size);
+	if (rc != EOK)
 		return rc;
-	}
-
+	
 	/* Compute address of the first block */
 	uint64_t first_block = EXT4_SUPERBLOCK_OFFSET / phys_block_size;
+	
 	/* Compute number of block to write */
 	size_t block_count = EXT4_SUPERBLOCK_SIZE / phys_block_size;
-
+	
 	/* Check alignment */
-	if (EXT4_SUPERBLOCK_SIZE % phys_block_size) {
+	if (EXT4_SUPERBLOCK_SIZE % phys_block_size)
 		block_count++;
-	}
-
+	
 	/* Write data */
 	return block_write_direct(service_id, first_block, block_count, sb);
-
 }
 
@@ -1040,45 +1182,40 @@
  * Checks are described by one-line comments in the code.
  *
- * @param sb		superblock to check
- * @return			error code
+ * @param sb Superblock to check
+ *
+ * @return Error code
+ *
  */
 int ext4_superblock_check_sanity(ext4_superblock_t *sb)
 {
-	if (ext4_superblock_get_magic(sb) != EXT4_SUPERBLOCK_MAGIC) {
+	if (ext4_superblock_get_magic(sb) != EXT4_SUPERBLOCK_MAGIC)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_inodes_count(sb) == 0) {
+	
+	if (ext4_superblock_get_inodes_count(sb) == 0)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_blocks_count(sb) == 0) {
+	
+	if (ext4_superblock_get_blocks_count(sb) == 0)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_blocks_per_group(sb) == 0) {
+	
+	if (ext4_superblock_get_blocks_per_group(sb) == 0)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_inodes_per_group(sb) == 0) {
+	
+	if (ext4_superblock_get_inodes_per_group(sb) == 0)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_inode_size(sb) < 128) {
+	
+	if (ext4_superblock_get_inode_size(sb) < 128)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_first_inode(sb) < 11) {
+	
+	if (ext4_superblock_get_first_inode(sb) < 11)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_desc_size(sb) < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE) {
+	
+	if (ext4_superblock_get_desc_size(sb) <
+	    EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
 		return ENOTSUP;
-	}
-
-	if (ext4_superblock_get_desc_size(sb) > EXT4_MAX_BLOCK_GROUP_DESCRIPTOR_SIZE) {
+	
+	if (ext4_superblock_get_desc_size(sb) >
+	    EXT4_MAX_BLOCK_GROUP_DESCRIPTOR_SIZE)
 		return ENOTSUP;
-	}
-
+	
 	return EOK;
 }
@@ -1086,6 +1223,8 @@
 /** Compute number of block groups in the filesystem.
  *
- * @param sb		superblock
- * @return			number of block groups
+ * @param sb Superblock
+ *
+ * @return Number of block groups
+ *
  */
 uint32_t ext4_superblock_get_block_group_count(ext4_superblock_t *sb)
@@ -1093,56 +1232,60 @@
 	uint64_t blocks_count = ext4_superblock_get_blocks_count(sb);
 	uint32_t blocks_per_group = ext4_superblock_get_blocks_per_group(sb);
-
+	
 	uint32_t block_groups_count = blocks_count / blocks_per_group;
-
-	if (blocks_count % blocks_per_group) {
+	
+	if (blocks_count % blocks_per_group)
 		block_groups_count++;
-	}
-
+	
 	return block_groups_count;
-
 }
 
 /** Compute number of blocks in specified block group.
  *
- * @param sb			superblock
- * @param bgid			block group index
- * @return				number of blocks
+ * @param sb   Superblock
+ * @param bgid Block group index
+ *
+ * @return Number of blocks
+ *
  */
 uint32_t ext4_superblock_get_blocks_in_group(ext4_superblock_t *sb, uint32_t bgid)
 {
-	uint32_t block_group_count = ext4_superblock_get_block_group_count(sb);
-	uint32_t blocks_per_group = ext4_superblock_get_blocks_per_group(sb);
-	uint64_t total_blocks = ext4_superblock_get_blocks_count(sb);
-
-	if (bgid < block_group_count - 1) {
+	uint32_t block_group_count =
+	    ext4_superblock_get_block_group_count(sb);
+	uint32_t blocks_per_group =
+	    ext4_superblock_get_blocks_per_group(sb);
+	uint64_t total_blocks =
+	    ext4_superblock_get_blocks_count(sb);
+	
+	if (bgid < block_group_count - 1)
 		return blocks_per_group;
-	} else {
+	else
 		return (total_blocks - ((block_group_count - 1) * blocks_per_group));
-	}
-
 }
 
 /** Compute number of i-nodes in specified block group.
  *
- * @param sb		superblock
- * @param bgid		block group index
- * @return			number of i-nodes
+ * @param sb   Superblock
+ * @param bgid Block group index
+ *
+ * @return Number of i-nodes
+ *
  */
 uint32_t ext4_superblock_get_inodes_in_group(ext4_superblock_t *sb, uint32_t bgid)
 {
-	uint32_t block_group_count = ext4_superblock_get_block_group_count(sb);
-	uint32_t inodes_per_group = ext4_superblock_get_inodes_per_group(sb);
-	uint32_t total_inodes = ext4_superblock_get_inodes_count(sb);
-
-	if (bgid < block_group_count - 1) {
+	uint32_t block_group_count =
+	    ext4_superblock_get_block_group_count(sb);
+	uint32_t inodes_per_group =
+	    ext4_superblock_get_inodes_per_group(sb);
+	uint32_t total_inodes =
+	    ext4_superblock_get_inodes_count(sb);
+	
+	if (bgid < block_group_count - 1)
 		return inodes_per_group;
-	} else {
+	else
 		return (total_inodes - ((block_group_count - 1) * inodes_per_group));
-	}
-
 }
 
 /**
  * @}
- */ 
+ */
