Index: uspace/lib/ext2/libext2.h
===================================================================
--- uspace/lib/ext2/libext2.h	(revision e2729490c49a14c12cbf5fc99e4232c52c784203)
+++ uspace/lib/ext2/libext2.h	(revision 566c401d35fe2aa13729441b683fcf35bf38afa6)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Martin Sucha
+ * Copyright (c) 2011 Martin Sucha
  * All rights reserved.
  *
@@ -50,8 +50,10 @@
 	uint8_t		unused2[12];
 	uint16_t	magic; // Magic value
-} __attribute__ ((packed)) ext2_superblock_t;
+
 // TODO: add __attribute__((aligned(...)) for better performance?
 //       (it is necessary to ensure the superblock is correctly aligned then
 //        though)
+} __attribute__ ((packed)) ext2_superblock_t;
+
 
 typedef struct ext2_filesystem {
@@ -66,17 +68,17 @@
 									 EXT2_SUPERBLOCK_SIZE -1)
 
-inline uint16_t	ext2_superblock_get_magic(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_first_block(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_block_size_log2(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_block_size(ext2_superblock_t *sb);
-inline int32_t	ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_fragment_size(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb);
-inline uint32_t	ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb);
+inline uint16_t	ext2_superblock_get_magic(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_first_block(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_block_size_log2(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_block_size(ext2_superblock_t *);
+inline int32_t	ext2_superblock_get_fragment_size_log2(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_fragment_size(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_blocks_per_group(ext2_superblock_t *);
+inline uint32_t	ext2_superblock_get_fragments_per_group(ext2_superblock_t *);
 
-int ext2_superblock_read_direct(devmap_handle_t, ext2_superblock_t **);
+extern int ext2_superblock_read_direct(devmap_handle_t, ext2_superblock_t **);
 
-int ext2_filesystem_init(ext2_filesystem_t *fs, devmap_handle_t dev);
-void ext2_filesystem_fini(ext2_filesystem_t *fs);
+extern int ext2_filesystem_init(ext2_filesystem_t *, devmap_handle_t);
+extern void ext2_filesystem_fini(ext2_filesystem_t *);
 
 #endif
Index: uspace/lib/ext2/libext2_filesystem.c
===================================================================
--- uspace/lib/ext2/libext2_filesystem.c	(revision e2729490c49a14c12cbf5fc99e4232c52c784203)
+++ uspace/lib/ext2/libext2_filesystem.c	(revision 566c401d35fe2aa13729441b683fcf35bf38afa6)
@@ -43,10 +43,14 @@
  * This function reads superblock from the device and
  * initializes libblock cache with appropriate logical block size.
+ * 
+ * @param fs Pointer to ext2_filesystem_t to initialize
+ * @param devmap_handle Device handle of the block device
  */
-int ext2_filesystem_init(ext2_filesystem_t *fs, devmap_handle_t dev) {
+int ext2_filesystem_init(ext2_filesystem_t *fs, devmap_handle_t devmap_handle)
+{
 	int rc;
 	ext2_superblock_t *temp_superblock;
 	
-	fs->device = dev;
+	fs->device = devmap_handle;
 	
 	rc = block_init(fs->device, 2048);
@@ -55,7 +59,7 @@
 	}
 	
-	rc = ext2_superblock_read_direct(dev, &temp_superblock);
+	rc = ext2_superblock_read_direct(fs->device, &temp_superblock);
 	if (rc != EOK) {
-		block_fini(dev);
+		block_fini(fs->device);
 		return rc;
 	}
@@ -68,6 +72,9 @@
 /**
  * Finalize an instance of filesystem
+ * 
+ * @param fs Pointer to ext2_filesystem_t to finalize
  */
-void ext2_filesystem_fini(ext2_filesystem_t *fs) {
+void ext2_filesystem_fini(ext2_filesystem_t *fs)
+{
 	block_fini(fs->device);
 }
Index: uspace/lib/ext2/libext2_superblock.c
===================================================================
--- uspace/lib/ext2/libext2_superblock.c	(revision e2729490c49a14c12cbf5fc99e4232c52c784203)
+++ uspace/lib/ext2/libext2_superblock.c	(revision 566c401d35fe2aa13729441b683fcf35bf38afa6)
@@ -42,6 +42,9 @@
  * Return a magic number from ext2 superblock, this should be equal to
  * EXT_SUPERBLOCK_MAGIC for valid ext2 superblock
+ * 
+ * @param sb pointer to superblock
  */
-inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb) {
+inline uint16_t ext2_superblock_get_magic(ext2_superblock_t *sb)
+{
 	return uint16_t_le2host(sb->magic);
 }
@@ -50,6 +53,9 @@
  * Get the position of first ext2 data block (i.e. the block number
  * containing main superblock)
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_first_block(ext2_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->first_block);
 }
@@ -58,6 +64,9 @@
  * Get the number of bits to shift a value of 1024 to the left necessary
  * to get the size of a block
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_block_size_log2(ext2_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->block_size_log2);
 }
@@ -65,6 +74,9 @@
 /**
  * Get the size of a block, in bytes 
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_block_size(ext2_superblock_t *sb)
+{
 	return 1024 << ext2_superblock_get_block_size(sb);
 }
@@ -74,6 +86,9 @@
  * to get the size of a fragment (note that this is a signed integer and
  * if negative, the value should be shifted to the right instead)
+ * 
+ * @param sb pointer to superblock
  */
-inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb) {
+inline int32_t ext2_superblock_get_fragment_size_log2(ext2_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->fragment_size_log2);
 }
@@ -81,6 +96,9 @@
 /**
  * Get the size of a fragment, in bytes 
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_fragment_size(ext2_superblock_t *sb)
+{
 	int32_t log = ext2_superblock_get_fragment_size_log2(sb);
 	if (log >= 0) {
@@ -94,6 +112,9 @@
 /**
  * Get number of blocks per block group
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_blocks_per_group(ext2_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->blocks_per_group);
 }
@@ -101,6 +122,9 @@
 /**
  * Get number of fragments per block group
+ * 
+ * @param sb pointer to superblock
  */
-inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb) {
+inline uint32_t ext2_superblock_get_fragments_per_group(ext2_superblock_t *sb)
+{
 	return uint32_t_le2host(sb->fragments_per_group);
 }
