Index: uspace/lib/ext4/src/balloc.c
===================================================================
--- uspace/lib/ext4/src/balloc.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/balloc.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -57,10 +57,10 @@
 	ext4_filesystem_t *fs = inode_ref->fs;
 	ext4_superblock_t *sb = fs->superblock;
-	
+
 	/* Compute indexes */
 	uint32_t block_group = ext4_filesystem_blockaddr2group(sb, block_addr);
 	uint32_t index_in_group =
 	    ext4_filesystem_blockaddr2_index_in_group(sb, block_addr);
-	
+
 	/* Load block group reference */
 	ext4_block_group_ref_t *bg_ref;
@@ -68,5 +68,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Load block with bitmap */
 	uint32_t bitmap_block_addr =
@@ -78,9 +78,9 @@
 		return rc;
 	}
-	
+
 	/* Modify bitmap */
 	ext4_bitmap_free_bit(bitmap_block->data, index_in_group);
 	bitmap_block->dirty = true;
-	
+
 	/* Release block with bitmap */
 	rc = block_put(bitmap_block);
@@ -90,7 +90,7 @@
 		return rc;
 	}
-	
+
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
-	
+
 	/* Update superblock free blocks count */
 	uint32_t sb_free_blocks =
@@ -98,5 +98,5 @@
 	sb_free_blocks++;
 	ext4_superblock_set_free_blocks_count(sb, sb_free_blocks);
-	
+
 	/* Update inode blocks count */
 	uint64_t ino_blocks =
@@ -105,5 +105,5 @@
 	ext4_inode_set_blocks_count(sb, inode_ref->inode, ino_blocks);
 	inode_ref->dirty = true;
-	
+
 	/* Update block group free blocks count */
 	uint32_t free_blocks =
@@ -113,5 +113,5 @@
 	    sb, free_blocks);
 	bg_ref->dirty = true;
-	
+
 	/* Release block group reference */
 	return ext4_filesystem_put_block_group_ref(bg_ref);
@@ -346,5 +346,5 @@
 {
 	uint32_t allocated_block = 0;
-	
+
 	uint32_t bitmap_block_addr;
 	block_t *bitmap_block;
@@ -352,5 +352,5 @@
 	uint32_t free_blocks;
 	uint32_t goal;
-	
+
 	/* Find GOAL */
 	errno_t rc = ext4_balloc_find_goal(inode_ref, &goal);
@@ -359,10 +359,10 @@
 
 	ext4_superblock_t *sb = inode_ref->fs->superblock;
-	
+
 	/* Load block group number for goal and relative index */
 	uint32_t block_group = ext4_filesystem_blockaddr2group(sb, goal);
 	uint32_t index_in_group =
 	    ext4_filesystem_blockaddr2_index_in_group(sb, goal);
-	
+
 	/* Load block group reference */
 	ext4_block_group_ref_t *bg_ref;
@@ -378,19 +378,19 @@
 		goto goal_failed;
 	}
-	
+
 	/* Compute indexes */
 	uint32_t first_in_group =
 	    ext4_balloc_get_first_data_block_in_group(sb, bg_ref);
-	
+
 	uint32_t first_in_group_index =
 	    ext4_filesystem_blockaddr2_index_in_group(sb, first_in_group);
-	
+
 	if (index_in_group < first_in_group_index)
 		index_in_group = first_in_group_index;
-	
+
 	/* Load block with bitmap */
 	bitmap_block_addr =
 	    ext4_block_group_get_block_bitmap(bg_ref->block_group, sb);
-	
+
 	rc = block_get(&bitmap_block, inode_ref->fs->device,
 	    bitmap_block_addr, BLOCK_FLAGS_NONE);
@@ -399,5 +399,5 @@
 		return rc;
 	}
-	
+
 	/* Check if goal is free */
 	if (ext4_bitmap_is_free_bit(bitmap_block->data, index_in_group)) {
@@ -409,19 +409,19 @@
 			return rc;
 		}
-		
+
 		allocated_block =
 		    ext4_filesystem_index_in_group2blockaddr(sb, index_in_group,
 		    block_group);
-		
+
 		goto success;
 	}
-	
+
 	uint32_t blocks_in_group =
 	    ext4_superblock_get_blocks_in_group(sb, block_group);
-	
+
 	uint32_t end_idx = (index_in_group + 63) & ~63;
 	if (end_idx > blocks_in_group)
 		end_idx = blocks_in_group;
-	
+
 	/* Try to find free block near to goal */
 	for (uint32_t tmp_idx = index_in_group + 1; tmp_idx < end_idx;
@@ -433,13 +433,13 @@
 			if (rc != EOK)
 				return rc;
-			
+
 			allocated_block =
 			    ext4_filesystem_index_in_group2blockaddr(sb, tmp_idx,
 			    block_group);
-			
+
 			goto success;
 		}
 	}
-	
+
 	/* Find free BYTE in bitmap */
 	rc = ext4_bitmap_find_free_byte_and_set_bit(bitmap_block->data,
@@ -450,12 +450,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		allocated_block =
 		    ext4_filesystem_index_in_group2blockaddr(sb, rel_block_idx,
 		    block_group);
-		
+
 		goto success;
 	}
-	
+
 	/* Find free bit in bitmap */
 	rc = ext4_bitmap_find_free_bit_and_set(bitmap_block->data,
@@ -466,12 +466,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		allocated_block =
 		    ext4_filesystem_index_in_group2blockaddr(sb, rel_block_idx,
 		    block_group);
-		
+
 		goto success;
 	}
-	
+
 	/* No free block found yet */
 	rc = block_put(bitmap_block);
@@ -486,11 +486,11 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Try other block groups */
 	uint32_t block_group_count = ext4_superblock_get_block_group_count(sb);
-	
+
 	uint32_t bgid = (block_group + 1) % block_group_count;
 	uint32_t count = block_group_count;
-	
+
 	while (count > 0) {
 		rc = ext4_filesystem_get_block_group_ref(inode_ref->fs, bgid,
@@ -509,5 +509,5 @@
 		bitmap_block_addr =
 		    ext4_block_group_get_block_bitmap(bg_ref->block_group, sb);
-		
+
 		rc = block_get(&bitmap_block, inode_ref->fs->device,
 		    bitmap_block_addr, 0);
@@ -516,5 +516,5 @@
 			return rc;
 		}
-		
+
 		/* Compute indexes */
 		first_in_group =
@@ -523,11 +523,11 @@
 		    ext4_filesystem_blockaddr2_index_in_group(sb, first_in_group);
 		blocks_in_group = ext4_superblock_get_blocks_in_group(sb, bgid);
-		
+
 		first_in_group_index =
 		    ext4_filesystem_blockaddr2_index_in_group(sb, first_in_group);
-		
+
 		if (index_in_group < first_in_group_index)
 			index_in_group = first_in_group_index;
-		
+
 		/* Try to find free byte in bitmap */
 		rc = ext4_bitmap_find_free_byte_and_set_bit(bitmap_block->data,
@@ -540,12 +540,12 @@
 				return rc;
 			}
-			
+
 			allocated_block =
 			    ext4_filesystem_index_in_group2blockaddr(sb, rel_block_idx,
 			    bgid);
-			
+
 			goto success;
 		}
-		
+
 		/* Try to find free bit in bitmap */
 		rc = ext4_bitmap_find_free_bit_and_set(bitmap_block->data,
@@ -558,12 +558,12 @@
 				return rc;
 			}
-			
+
 			allocated_block =
 			    ext4_filesystem_index_in_group2blockaddr(sb, rel_block_idx,
 			    bgid);
-			
+
 			goto success;
 		}
-		
+
 		rc = block_put(bitmap_block);
 		if (rc != EOK) {
@@ -576,23 +576,23 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Goto next group */
 		bgid = (bgid + 1) % block_group_count;
 		count--;
 	}
-	
+
 	return ENOSPC;
-	
+
 success:
 	/* Empty command - because of syntax */
 	;
-	
+
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
-	
+
 	/* Update superblock free blocks count */
 	uint32_t sb_free_blocks = ext4_superblock_get_free_blocks_count(sb);
 	sb_free_blocks--;
 	ext4_superblock_set_free_blocks_count(sb, sb_free_blocks);
-	
+
 	/* Update inode blocks (different block size!) count */
 	uint64_t ino_blocks =
@@ -601,5 +601,5 @@
 	ext4_inode_set_blocks_count(sb, inode_ref->inode, ino_blocks);
 	inode_ref->dirty = true;
-	
+
 	/* Update block group free blocks count */
 	uint32_t bg_free_blocks =
@@ -609,7 +609,7 @@
 	    bg_free_blocks);
 	bg_ref->dirty = true;
-	
+
 	rc = ext4_filesystem_put_block_group_ref(bg_ref);
-	
+
 	*fblock = allocated_block;
 	return rc;
@@ -629,13 +629,13 @@
 {
 	errno_t rc;
-	
+
 	ext4_filesystem_t *fs = inode_ref->fs;
 	ext4_superblock_t *sb = fs->superblock;
-	
+
 	/* Compute indexes */
 	uint32_t block_group = ext4_filesystem_blockaddr2group(sb, fblock);
 	uint32_t index_in_group =
 	    ext4_filesystem_blockaddr2_index_in_group(sb, fblock);
-	
+
 	/* Load block group reference */
 	ext4_block_group_ref_t *bg_ref;
@@ -643,5 +643,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Load block with bitmap */
 	uint32_t bitmap_block_addr =
@@ -653,8 +653,8 @@
 		return rc;
 	}
-	
+
 	/* Check if block is free */
 	*free = ext4_bitmap_is_free_bit(bitmap_block->data, index_in_group);
-	
+
 	/* Allocate block if possible */
 	if (*free) {
@@ -662,5 +662,5 @@
 		bitmap_block->dirty = true;
 	}
-	
+
 	/* Release block with bitmap */
 	rc = block_put(bitmap_block);
@@ -670,16 +670,16 @@
 		return rc;
 	}
-	
+
 	/* If block is not free, return */
 	if (!(*free))
 		goto terminate;
-	
+
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
-	
+
 	/* Update superblock free blocks count */
 	uint32_t sb_free_blocks = ext4_superblock_get_free_blocks_count(sb);
 	sb_free_blocks--;
 	ext4_superblock_set_free_blocks_count(sb, sb_free_blocks);
-	
+
 	/* Update inode blocks count */
 	uint64_t ino_blocks =
@@ -688,5 +688,5 @@
 	ext4_inode_set_blocks_count(sb, inode_ref->inode, ino_blocks);
 	inode_ref->dirty = true;
-	
+
 	/* Update block group free blocks count */
 	uint32_t free_blocks =
@@ -696,5 +696,5 @@
 	    sb, free_blocks);
 	bg_ref->dirty = true;
-	
+
 terminate:
 	return ext4_filesystem_put_block_group_ref(bg_ref);
Index: uspace/lib/ext4/src/bitmap.c
===================================================================
--- uspace/lib/ext4/src/bitmap.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/bitmap.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -52,7 +52,7 @@
 	uint32_t byte_index = index / 8;
 	uint32_t bit_index = index % 8;
-	
+
 	uint8_t *target = bitmap + byte_index;
-	
+
 	*target &= ~ (1 << bit_index);
 }
@@ -73,45 +73,45 @@
 	uint32_t remaining = count;
 	uint32_t byte_index;
-	
+
 	/* Align index to multiple of 8 */
 	while (((idx % 8) != 0) && (remaining > 0)) {
 		byte_index = idx / 8;
 		uint32_t bit_index = idx % 8;
-		
+
 		target = bitmap + byte_index;
 		*target &= ~ (1 << bit_index);
-		
+
 		idx++;
 		remaining--;
 	}
-	
+
 	/* For < 8 bits this check necessary */
 	if (remaining == 0)
 		return;
-	
+
 	assert((idx % 8) == 0);
-	
+
 	byte_index = idx / 8;
 	target = bitmap + byte_index;
-	
+
 	/* Zero the whole bytes */
 	while (remaining >= 8) {
 		*target = 0;
-		
+
 		idx += 8;
 		remaining -= 8;
 		target++;
 	}
-	
+
 	assert(remaining < 8);
-	
+
 	/* Zero remaining bytes */
 	while (remaining != 0) {
 		byte_index = idx / 8;
 		uint32_t bit_index = idx % 8;
-		
+
 		target = bitmap + byte_index;
 		*target &= ~ (1 << bit_index);
-		
+
 		idx++;
 		remaining--;
@@ -129,7 +129,7 @@
 	uint32_t byte_index = index / 8;
 	uint32_t bit_index = index % 8;
-	
+
 	uint8_t *target = bitmap + byte_index;
-	
+
 	*target |= 1 << bit_index;
 }
@@ -147,7 +147,7 @@
 	uint32_t byte_index = index / 8;
 	uint32_t bit_index = index % 8;
-	
+
 	uint8_t *target = bitmap + byte_index;
-	
+
 	if (*target & (1 << bit_index))
 		return false;
@@ -173,5 +173,5 @@
 {
 	uint32_t idx;
-	
+
 	/* Align idx */
 	if (start % 8)
@@ -179,20 +179,20 @@
 	else
 		idx = start;
-	
+
 	uint8_t *pos = bitmap + (idx / 8);
-	
+
 	/* Try to find free byte */
 	while (idx < max) {
 		if (*pos == 0) {
 			*pos |= 1;
-			
+
 			*index = idx;
 			return EOK;
 		}
-		
+
 		idx += 8;
 		++pos;
 	}
-	
+
 	/* Free byte not found */
 	return ENOSPC;
@@ -217,9 +217,9 @@
 	uint32_t idx = start_idx;
 	bool byte_part = false;
-	
+
 	/* Check the rest of first byte */
 	while ((idx % 8) != 0) {
 		byte_part = true;
-		
+
 		if ((*pos & (1 << (idx % 8))) == 0) {
 			*pos |= (1 << (idx % 8));
@@ -227,11 +227,11 @@
 			return EOK;
 		}
-		
+
 		++idx;
 	}
-	
+
 	if (byte_part)
 		++pos;
-	
+
 	/* Check the whole bytes (255 = 11111111 binary) */
 	while (idx < max) {
@@ -240,9 +240,9 @@
 			break;
 		}
-		
+
 		idx += 8;
 		++pos;
 	}
-	
+
 	/* If idx < max, some free bit found */
 	if (idx < max) {
@@ -252,13 +252,13 @@
 				/* Free bit found */
 				*pos |= (1 << i);
-				
+
 				*index = idx;
 				return EOK;
 			}
-			
+
 			idx++;
 		}
 	}
-	
+
 	/* Free bit not found */
 	return ENOSPC;
Index: uspace/lib/ext4/src/block_group.c
===================================================================
--- uspace/lib/ext4/src/block_group.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/block_group.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -70,5 +70,5 @@
 {
 	bg->block_bitmap_lo = host2uint32_t_le((block_bitmap << 32) >> 32);
-	
+
 	if (ext4_superblock_get_desc_size(sb) >
 	    EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
@@ -106,5 +106,5 @@
 {
 	bg->inode_bitmap_lo = host2uint32_t_le((inode_bitmap << 32) >> 32);
-	
+
 	if (ext4_superblock_get_desc_size(sb) >
 	    EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
@@ -144,5 +144,5 @@
 	bg->inode_table_first_block_lo =
 	    host2uint32_t_le((inode_table_first << 32) >> 32);
-	
+
 	if (ext4_superblock_get_desc_size(sb) >
 	    EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
@@ -353,5 +353,5 @@
 	if (ext4_block_group_get_flags(bg) & flag)
 		return true;
-	
+
 	return false;
 }
Index: uspace/lib/ext4/src/directory.c
===================================================================
--- uspace/lib/ext4/src/directory.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/directory.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -110,5 +110,5 @@
 		return ((uint16_t)de->name_length_high) << 8 |
 		    ((uint16_t)de->name_length);
-	
+
 	return de->name_length;
 
@@ -126,9 +126,9 @@
 {
 	de->name_length = (length << 8) >> 8;
-	
+
 	if ((ext4_superblock_get_rev_level(sb) == 0) &&
 	    (ext4_superblock_get_minor_rev_level(sb) < 5))
 		de->name_length_high = length >> 8;
-	
+
 	/* Else do nothing */
 }
@@ -148,5 +148,5 @@
 	    (ext4_superblock_get_minor_rev_level(sb) >= 5))
 		return de->inode_type;
-	
+
 	return EXT4_DIRECTORY_FILETYPE_UNKNOWN;
 }
@@ -165,5 +165,5 @@
 	    (ext4_superblock_get_minor_rev_level(sb) >= 5))
 		de->inode_type = type;
-	
+
 	/* Else do nothing */
 }
@@ -190,5 +190,5 @@
 	it->current_offset = 0;
 	it->current_block = NULL;
-	
+
 	return ext4_directory_iterator_seek(it, pos);
 }
@@ -204,7 +204,7 @@
 {
 	assert(it->current != NULL);
-	
+
 	uint16_t skip = ext4_directory_entry_ll_get_entry_length(it->current);
-	
+
 	return ext4_directory_iterator_seek(it, it->current_offset + skip);
 }
@@ -224,8 +224,8 @@
 	uint64_t size = ext4_inode_get_size(it->inode_ref->fs->superblock,
 	    it->inode_ref->inode);
-	
+
 	/* The iterator is not valid until we seek to the desired position */
 	it->current = NULL;
-	
+
 	/* Are we at the end? */
 	if (pos >= size) {
@@ -233,13 +233,13 @@
 			errno_t rc = block_put(it->current_block);
 			it->current_block = NULL;
-			
+
 			if (rc != EOK)
 				return rc;
 		}
-		
+
 		it->current_offset = pos;
 		return EOK;
 	}
-	
+
 	/* Compute next block address */
 	uint32_t block_size =
@@ -247,5 +247,5 @@
 	aoff64_t current_block_idx = it->current_offset / block_size;
 	aoff64_t next_block_idx = pos / block_size;
-	
+
 	/*
 	 * If we don't have a block or are moving accross block boundary,
@@ -257,9 +257,9 @@
 			errno_t rc = block_put(it->current_block);
 			it->current_block = NULL;
-			
+
 			if (rc != EOK)
 				return rc;
 		}
-		
+
 		uint32_t next_block_phys_idx;
 		errno_t rc = ext4_filesystem_get_inode_data_block_index(it->inode_ref,
@@ -267,5 +267,5 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		rc = block_get(&it->current_block, it->inode_ref->fs->device,
 		    next_block_phys_idx, BLOCK_FLAGS_NONE);
@@ -275,7 +275,7 @@
 		}
 	}
-	
+
 	it->current_offset = pos;
-	
+
 	return ext4_directory_iterator_set(it, block_size);
 }
@@ -293,28 +293,28 @@
 {
 	it->current = NULL;
-	
+
 	uint32_t offset_in_block = it->current_offset % block_size;
-	
+
 	/* Ensure proper alignment */
 	if ((offset_in_block % 4) != 0)
 		return EIO;
-	
+
 	/* Ensure that the core of the entry does not overflow the block */
 	if (offset_in_block > block_size - 8)
 		return EIO;
-	
+
 	ext4_directory_entry_ll_t *entry =
 	    it->current_block->data + offset_in_block;
-	
+
 	/* Ensure that the whole entry does not overflow the block */
 	uint16_t length = ext4_directory_entry_ll_get_entry_length(entry);
 	if (offset_in_block + length > block_size)
 		return EIO;
-	
+
 	/* Ensure the name length is not too large */
 	if (ext4_directory_entry_ll_get_name_length(
 	    it->inode_ref->fs->superblock, entry) > length-8)
 		return EIO;
-	
+
 	/* Everything OK - "publish" the entry */
 	it->current = entry;
@@ -335,8 +335,8 @@
 	it->inode_ref = NULL;
 	it->current = NULL;
-	
+
 	if (it->current_block)
 		return block_put(it->current_block);
-	
+
 	return EOK;
 }
@@ -359,13 +359,13 @@
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
 	assert(entry_len <= block_size);
-	
+
 	/* Set basic attributes */
 	ext4_directory_entry_ll_set_inode(entry, child->index);
 	ext4_directory_entry_ll_set_entry_length(entry, entry_len);
 	ext4_directory_entry_ll_set_name_length(sb, entry, name_len);
-	
+
 	/* Write name */
 	memcpy(entry->name, name, name_len);
-	
+
 	/* Set type of entry */
 	if (ext4_inode_is_type(sb, child->inode, EXT4_INODE_MODE_DIRECTORY))
@@ -390,5 +390,5 @@
 {
 	ext4_filesystem_t *fs = parent->fs;
-	
+
 	/* Index adding (if allowed) */
 	if ((ext4_superblock_has_feature_compatible(fs->superblock,
@@ -405,7 +405,7 @@
 		parent->dirty = true;
 	}
-	
+
 	/* Linear algorithm */
-	
+
 	uint32_t iblock = 0;
 	uint32_t fblock = 0;
@@ -413,7 +413,7 @@
 	uint32_t inode_size = ext4_inode_get_size(fs->superblock, parent->inode);
 	uint32_t total_blocks = inode_size / block_size;
-	
+
 	uint32_t name_len = str_size(name);
-	
+
 	/* Find block, where is space for new entry and try to add */
 	bool success = false;
@@ -423,10 +423,10 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		block_t *block;
 		rc = block_get(&block, fs->device, fblock, BLOCK_FLAGS_NONE);
 		if (rc != EOK)
 			return rc;
-		
+
 		/* If adding is successful, function can finish */
 		rc = ext4_directory_try_insert_entry(fs->superblock, block,
@@ -434,15 +434,15 @@
 		if (rc == EOK)
 			success = true;
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
-		
+
 		if (success)
 			return EOK;
 	}
-	
+
 	/* No free block found - needed to allocate next data block */
-	
+
 	iblock = 0;
 	fblock = 0;
@@ -450,5 +450,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Load new block */
 	block_t *new_block;
@@ -456,5 +456,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Fill block with zeroes */
 	memset(new_block->data, 0, block_size);
@@ -462,9 +462,9 @@
 	ext4_directory_write_entry(fs->superblock, block_entry, block_size,
 	    child, name, name_len);
-	
+
 	/* Save new block */
 	new_block->dirty = true;
 	rc = block_put(new_block);
-	
+
 	return rc;
 }
@@ -483,7 +483,7 @@
 {
 	uint32_t name_len = str_size(name);
-	
+
 	ext4_superblock_t *sb = parent->fs->superblock;
-	
+
 	/* Index search */
 	if ((ext4_superblock_has_feature_compatible(sb,
@@ -492,20 +492,20 @@
 		errno_t rc = ext4_directory_dx_find_entry(result, parent, name_len,
 		    name);
-		
+
 		/* Check if index is not corrupted */
 		if (rc != EXT4_ERR_BAD_DX_DIR) {
 			if (rc != EOK)
 				return rc;
-			
+
 			return EOK;
 		}
-		
+
 		/* Needed to clear dir index flag if corrupted */
 		ext4_inode_clear_flag(parent->inode, EXT4_INODE_FLAG_INDEX);
 		parent->dirty = true;
 	}
-	
+
 	/* Linear algorithm */
-	
+
 	uint32_t iblock;
 	uint32_t fblock;
@@ -513,5 +513,5 @@
 	uint32_t inode_size = ext4_inode_get_size(sb, parent->inode);
 	uint32_t total_blocks = inode_size / block_size;
-	
+
 	/* Walk through all data blocks */
 	for (iblock = 0; iblock < total_blocks; ++iblock) {
@@ -521,5 +521,5 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Load data block */
 		block_t *block;
@@ -527,5 +527,5 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Try to find entry in block */
 		ext4_directory_entry_ll_t *res_entry;
@@ -537,17 +537,17 @@
 			return EOK;
 		}
-		
+
 		/* Entry not found - put block and continue to the next block */
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
 	}
-	
+
 	/* Entry was not found */
-	
+
 	result->block = NULL;
 	result->dentry =  NULL;
-	
+
 	return ENOENT;
 }
@@ -567,5 +567,5 @@
 	    EXT4_INODE_MODE_DIRECTORY))
 		return ENOTDIR;
-	
+
 	/* Try to find entry */
 	ext4_directory_search_result_t result;
@@ -573,11 +573,11 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Invalidate entry */
 	ext4_directory_entry_ll_set_inode(result.dentry, 0);
-	
+
 	/* Store entry position in block */
 	uint32_t pos = (void *) result.dentry - result.block->data;
-	
+
 	/*
 	 * If entry is not the first in block, it must be merged
@@ -586,10 +586,10 @@
 	if (pos != 0) {
 		uint32_t offset = 0;
-		
+
 		/* Start from the first entry in block */
 		ext4_directory_entry_ll_t *tmp_dentry = result.block->data;
 		uint16_t tmp_dentry_length =
 		    ext4_directory_entry_ll_get_entry_length(tmp_dentry);
-		
+
 		/* Find direct predecessor of removed entry */
 		while ((offset + tmp_dentry_length) < pos) {
@@ -600,7 +600,7 @@
 			    ext4_directory_entry_ll_get_entry_length(tmp_dentry);
 		}
-		
+
 		assert(tmp_dentry_length + offset == pos);
-		
+
 		/* Add to removed entry length to predecessor's length */
 		uint16_t del_entry_length =
@@ -609,7 +609,7 @@
 		    tmp_dentry_length + del_entry_length);
 	}
-	
+
 	result.block->dirty = true;
-	
+
 	return ext4_directory_destroy_result(&result);
 }
@@ -633,12 +633,12 @@
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
 	uint16_t required_len = sizeof(ext4_fake_directory_entry_t) + name_len;
-	
+
 	if ((required_len % 4) != 0)
 		required_len += 4 - (required_len % 4);
-	
+
 	/* Initialize pointers, stop means to upper bound */
 	ext4_directory_entry_ll_t *dentry = target_block->data;
 	ext4_directory_entry_ll_t *stop = target_block->data + block_size;
-	
+
 	/*
 	 * Walk through the block and check for invalid entries
@@ -648,5 +648,5 @@
 		uint32_t inode = ext4_directory_entry_ll_get_inode(dentry);
 		uint16_t rec_len = ext4_directory_entry_ll_get_entry_length(dentry);
-		
+
 		/* If invalid and large enough entry, use it */
 		if ((inode == 0) && (rec_len >= required_len)) {
@@ -654,21 +654,21 @@
 			    name, name_len);
 			target_block->dirty = true;
-			
+
 			return EOK;
 		}
-		
+
 		/* Valid entry, try to split it */
 		if (inode != 0) {
 			uint16_t used_name_len =
 			    ext4_directory_entry_ll_get_name_length(sb, dentry);
-			
+
 			uint16_t used_space =
 			    sizeof(ext4_fake_directory_entry_t) + used_name_len;
-			
+
 			if ((used_name_len % 4) != 0)
 				used_space += 4 - (used_name_len % 4);
-			
+
 			uint16_t free_space = rec_len - used_space;
-			
+
 			/* There is free space for new entry */
 			if (free_space >= required_len) {
@@ -679,15 +679,15 @@
 				ext4_directory_write_entry(sb, new_entry,
 				    free_space, child, name, name_len);
-				
+
 				target_block->dirty = true;
-				
+
 				return EOK;
 			}
 		}
-		
+
 		/* Jump to the next entry */
 		dentry = (void *) dentry + rec_len;
 	}
-	
+
 	/* No free space found for new entry */
 	return ENOSPC;
@@ -711,8 +711,8 @@
 	ext4_directory_entry_ll_t *dentry =
 	    (ext4_directory_entry_ll_t *) block->data;
-	
+
 	/* Set upper bound for cycling */
 	uint8_t *addr_limit = block->data + ext4_superblock_get_block_size(sb);
-	
+
 	/* Walk through the block and check entries */
 	while ((uint8_t *) dentry < addr_limit) {
@@ -720,5 +720,5 @@
 		if ((uint8_t *) dentry + name_len > addr_limit)
 			break;
-		
+
 		/* Valid entry - check it */
 		if (dentry->inode != 0) {
@@ -733,16 +733,16 @@
 			}
 		}
-		
+
 		uint16_t dentry_len =
 		    ext4_directory_entry_ll_get_entry_length(dentry);
-		
+
 		/* Corrupted entry */
 		if (dentry_len == 0)
 			return EINVAL;
-		
+
 		/* Jump to next entry */
 		dentry = (ext4_directory_entry_ll_t *) ((uint8_t *) dentry + dentry_len);
 	}
-	
+
 	/* Entry not found */
 	return ENOENT;
@@ -760,5 +760,5 @@
 	if (result->block)
 		return block_put(result->block);
-	
+
 	return EOK;
 }
Index: uspace/lib/ext4/src/directory_index.c
===================================================================
--- uspace/lib/ext4/src/directory_index.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/directory_index.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -244,27 +244,27 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	block_t *block;
 	rc = block_get(&block, dir->fs->device, fblock, BLOCK_FLAGS_NONE);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Initialize pointers to data structures */
 	ext4_directory_dx_root_t *root = block->data;
 	ext4_directory_dx_root_info_t *info = &(root->info);
-	
+
 	/* Initialize root info structure */
 	uint8_t hash_version =
 	    ext4_superblock_get_default_hash_version(dir->fs->superblock);
-	
+
 	ext4_directory_dx_root_info_set_hash_version(info, hash_version);
 	ext4_directory_dx_root_info_set_indirect_levels(info, 0);
 	ext4_directory_dx_root_info_set_info_length(info, 8);
-	
+
 	/* Set limit and current number of entries */
 	ext4_directory_dx_countlimit_t *countlimit =
 	    (ext4_directory_dx_countlimit_t *) &root->entries;
 	ext4_directory_dx_countlimit_set_count(countlimit, 1);
-	
+
 	uint32_t block_size =
 	    ext4_superblock_get_block_size(dir->fs->superblock);
@@ -274,5 +274,5 @@
 	uint16_t root_limit = entry_space / sizeof(ext4_directory_dx_entry_t);
 	ext4_directory_dx_countlimit_set_limit(countlimit, root_limit);
-	
+
 	/* Append new block, where will be new entries inserted in the future */
 	uint32_t iblock;
@@ -282,5 +282,5 @@
 		return rc;
 	}
-	
+
 	block_t *new_block;
 	rc = block_get(&new_block, dir->fs->device, fblock, BLOCK_FLAGS_NOREAD);
@@ -289,10 +289,10 @@
 		return rc;
 	}
-	
+
 	/* Fill the whole block with empty entry */
 	ext4_directory_entry_ll_t *block_entry = new_block->data;
 	ext4_directory_entry_ll_set_entry_length(block_entry, block_size);
 	ext4_directory_entry_ll_set_inode(block_entry, 0);
-	
+
 	new_block->dirty = true;
 	rc = block_put(new_block);
@@ -301,11 +301,11 @@
 		return rc;
 	}
-	
+
 	/* Connect new block to the only entry in index */
 	ext4_directory_dx_entry_t *entry = root->entries;
 	ext4_directory_dx_entry_set_block(entry, iblock);
-	
+
 	block->dirty = true;
-	
+
 	return block_put(block);
 }
@@ -328,18 +328,18 @@
 	ext4_directory_dx_root_t *root =
 	    (ext4_directory_dx_root_t *) root_block->data;
-	
+
 	if ((root->info.hash_version != EXT4_HASH_VERSION_TEA) &&
 	    (root->info.hash_version != EXT4_HASH_VERSION_HALF_MD4) &&
 	    (root->info.hash_version != EXT4_HASH_VERSION_LEGACY))
 		return EXT4_ERR_BAD_DX_DIR;
-	
+
 	/* Check unused flags */
 	if (root->info.unused_flags != 0)
 		return EXT4_ERR_BAD_DX_DIR;
-	
+
 	/* Check indirect levels */
 	if (root->info.indirect_levels > 1)
 		return EXT4_ERR_BAD_DX_DIR;
-	
+
 	/* Check if node limit is correct */
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
@@ -348,10 +348,10 @@
 	entry_space -= sizeof(ext4_directory_dx_root_info_t);
 	entry_space = entry_space / sizeof(ext4_directory_dx_entry_t);
-	
+
 	uint16_t limit = ext4_directory_dx_countlimit_get_limit(
 	    (ext4_directory_dx_countlimit_t *) &root->entries);
 	if (limit != entry_space)
 		return EXT4_ERR_BAD_DX_DIR;
-	
+
 	/* Check hash version and modify if necessary */
 	hinfo->hash_version =
@@ -362,12 +362,12 @@
 		hinfo->hash_version += 3;
 	}
-	
+
 	/* Load hash seed from superblock */
 	hinfo->seed = ext4_superblock_get_hash_seed(sb);
-	
+
 	/* Compute hash value of name */
 	if (name)
 		ext4_hash_string(hinfo, name_len, name);
-	
+
 	return EOK;
 }
@@ -393,10 +393,10 @@
 	ext4_directory_dx_entry_t *entries =
 	    (ext4_directory_dx_entry_t *) &root->entries;
-	
+
 	uint16_t limit = ext4_directory_dx_countlimit_get_limit(
 	    (ext4_directory_dx_countlimit_t *) entries);
 	uint8_t indirect_level =
 	    ext4_directory_dx_root_info_get_indirect_levels(&root->info);
-	
+
 	block_t *tmp_block = root_block;
 	ext4_directory_dx_entry_t *p;
@@ -404,5 +404,5 @@
 	ext4_directory_dx_entry_t *m;
 	ext4_directory_dx_entry_t *at;
-	
+
 	/* Walk through the index tree */
 	while (true) {
@@ -411,9 +411,9 @@
 		if ((count == 0) || (count > limit))
 			return EXT4_ERR_BAD_DX_DIR;
-		
+
 		/* Do binary search in every node */
 		p = entries + 1;
 		q = entries + count - 1;
-		
+
 		while (p <= q) {
 			m = p + (q - p) / 2;
@@ -423,12 +423,12 @@
 				p = m + 1;
 		}
-		
+
 		at = p - 1;
-		
+
 		/* Write results */
 		tmp_dx_block->block = tmp_block;
 		tmp_dx_block->entries = entries;
 		tmp_dx_block->position = at;
-		
+
 		/* Is algorithm in the leaf? */
 		if (indirect_level == 0) {
@@ -436,10 +436,10 @@
 			return EOK;
 		}
-		
+
 		/* Goto child node */
 		uint32_t next_block = ext4_directory_dx_entry_get_block(at);
-		
+
 		indirect_level--;
-		
+
 		uint32_t fblock;
 		errno_t rc = ext4_filesystem_get_inode_data_block_index(inode_ref,
@@ -447,27 +447,27 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		rc = block_get(&tmp_block, inode_ref->fs->device, fblock,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
 			return rc;
-		
+
 		entries = ((ext4_directory_dx_node_t *) tmp_block->data)->entries;
 		limit = ext4_directory_dx_countlimit_get_limit(
 		    (ext4_directory_dx_countlimit_t *) entries);
-		
+
 		uint16_t entry_space =
 		    ext4_superblock_get_block_size(inode_ref->fs->superblock) -
 		    sizeof(ext4_directory_dx_dot_entry_t);
 		entry_space = entry_space / sizeof(ext4_directory_dx_entry_t);
-		
+
 		if (limit != entry_space) {
 			block_put(tmp_block);
 			return EXT4_ERR_BAD_DX_DIR;
 		}
-		
+
 		++tmp_dx_block;
 	}
-	
+
 	/* Unreachable */
 	return EOK;
@@ -490,5 +490,5 @@
 	uint32_t num_handles = 0;
 	ext4_directory_dx_block_t *p = dx_block;
-	
+
 	/* Try to find data block with next bunch of entries */
 	while (true) {
@@ -496,15 +496,15 @@
 		uint16_t count = ext4_directory_dx_countlimit_get_count(
 		    (ext4_directory_dx_countlimit_t *) p->entries);
-		
+
 		if (p->position < p->entries + count)
 			break;
-		
+
 		if (p == dx_blocks)
 			return EOK;
-		
+
 		num_handles++;
 		p--;
 	}
-	
+
 	/* Check hash collision (if not occured - no next block cannot be used) */
 	uint32_t current_hash = ext4_directory_dx_entry_get_hash(p->position);
@@ -513,5 +513,5 @@
 			return 0;
 	}
-	
+
 	/* Fill new path */
 	while (num_handles--) {
@@ -519,27 +519,27 @@
 		    ext4_directory_dx_entry_get_block(p->position);
 		uint32_t block_addr;
-		
+
 		errno_t rc = ext4_filesystem_get_inode_data_block_index(inode_ref,
 		    block_idx, &block_addr);
 		if (rc != EOK)
 			return rc;
-		
+
 		block_t *block;
 		rc = block_get(&block, inode_ref->fs->device, block_addr, BLOCK_FLAGS_NONE);
 		if (rc != EOK)
 			return rc;
-		
+
 		p++;
-		
+
 		/* Don't forget to put old block (prevent memory leak) */
 		rc = block_put(p->block);
 		if (rc != EOK)
 			return rc;
-		
+
 		p->block = block;
 		p->entries = ((ext4_directory_dx_node_t *) block->data)->entries;
 		p->position = p->entries;
 	}
-	
+
 	return ENOENT;
 }
@@ -566,7 +566,7 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	ext4_filesystem_t *fs = inode_ref->fs;
-	
+
 	block_t *root_block;
 	rc = block_get(&root_block, fs->device, root_block_addr,
@@ -574,5 +574,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Initialize hash info (compute hash value) */
 	ext4_hash_info_t hinfo;
@@ -583,5 +583,5 @@
 		return EXT4_ERR_BAD_DX_DIR;
 	}
-	
+
 	/*
 	 * Hardcoded number 2 means maximum height of index tree,
@@ -591,5 +591,5 @@
 	ext4_directory_dx_block_t *dx_block;
 	ext4_directory_dx_block_t *tmp;
-	
+
 	rc = ext4_directory_dx_get_leaf(&hinfo, inode_ref, root_block,
 	    &dx_block, dx_blocks);
@@ -598,5 +598,5 @@
 		return EXT4_ERR_BAD_DX_DIR;
 	}
-	
+
 	do {
 		/* Load leaf block */
@@ -604,10 +604,10 @@
 		    ext4_directory_dx_entry_get_block(dx_block->position);
 		uint32_t leaf_block_addr;
-		
+
 		rc = ext4_filesystem_get_inode_data_block_index(inode_ref,
 		    leaf_block_idx, &leaf_block_addr);
 		if (rc != EOK)
 			goto cleanup;
-		
+
 		block_t *leaf_block;
 		rc = block_get(&leaf_block, fs->device, leaf_block_addr,
@@ -615,10 +615,10 @@
 		if (rc != EOK)
 			goto cleanup;
-		
+
 		/* Linear search inside block */
 		ext4_directory_entry_ll_t *res_dentry;
 		rc = ext4_directory_find_in_block(leaf_block, fs->superblock,
 		    name_len, name, &res_dentry);
-		
+
 		/* Found => return it */
 		if (rc == EOK) {
@@ -627,13 +627,13 @@
 			goto cleanup;
 		}
-		
+
 		/* Not found, leave untouched */
 		rc2 = block_put(leaf_block);
 		if (rc2 != EOK)
 			goto cleanup;
-		
+
 		if (rc != ENOENT)
 			goto cleanup;
-		
+
 		/* check if the next block could be checked */
 		rc = ext4_directory_dx_next_block(inode_ref, hinfo.hash,
@@ -643,12 +643,12 @@
 
 	} while (rc == ENOENT);
-	
+
 	/* Entry not found */
 	rc = ENOENT;
-	
+
 cleanup:
 	/* The whole path must be released (preventing memory leak) */
 	tmp = dx_blocks;
-	
+
 	while (tmp <= dx_block) {
 		rc2 = block_put(tmp->block);
@@ -657,5 +657,5 @@
 		++tmp;
 	}
-	
+
 	return rc;
 }
@@ -677,8 +677,8 @@
 	ext4_dx_sort_entry_t const *entry1 = arg1;
 	ext4_dx_sort_entry_t const *entry2 = arg2;
-	
+
 	if (entry1->hash == entry2->hash)
 		return 0;
-	
+
 	if (entry1->hash < entry2->hash)
 		return -1;
@@ -701,19 +701,19 @@
 	ext4_directory_dx_entry_t *old_index_entry = index_block->position;
 	ext4_directory_dx_entry_t *new_index_entry = old_index_entry + 1;
-	
+
 	ext4_directory_dx_countlimit_t *countlimit =
 	    (ext4_directory_dx_countlimit_t *) index_block->entries;
 	uint32_t count = ext4_directory_dx_countlimit_get_count(countlimit);
-	
+
 	ext4_directory_dx_entry_t *start_index = index_block->entries;
 	size_t bytes = (void *) (start_index + count) - (void *) (new_index_entry);
-	
+
 	memmove(new_index_entry + 1, new_index_entry, bytes);
-	
+
 	ext4_directory_dx_entry_set_block(new_index_entry, iblock);
 	ext4_directory_dx_entry_set_hash(new_index_entry, hash);
-	
+
 	ext4_directory_dx_countlimit_set_count(countlimit, count + 1);
-	
+
 	index_block->block->dirty = true;
 }
@@ -733,5 +733,5 @@
 {
 	errno_t rc = EOK;
-	
+
 	/* Allocate buffer for directory entries */
 	uint32_t block_size =
@@ -740,9 +740,9 @@
 	if (entry_buffer == NULL)
 		return ENOMEM;
-	
+
 	/* dot entry has the smallest size available */
 	uint32_t max_entry_count =
 	    block_size / sizeof(ext4_directory_dx_dot_entry_t);
-	
+
 	/* Allocate sort entry */
 	ext4_dx_sort_entry_t *sort_array =
@@ -752,12 +752,12 @@
 		return ENOMEM;
 	}
-	
+
 	uint32_t idx = 0;
 	uint32_t real_size = 0;
-	
+
 	/* Initialize hinfo */
 	ext4_hash_info_t tmp_hinfo;
 	memcpy(&tmp_hinfo, hinfo, sizeof(ext4_hash_info_t));
-	
+
 	/* Load all valid entries to the buffer */
 	ext4_directory_entry_ll_t *dentry = old_data_block->data;
@@ -769,29 +769,29 @@
 			    inode_ref->fs->superblock, dentry);
 			ext4_hash_string(&tmp_hinfo, len, (char *) dentry->name);
-			
+
 			uint32_t rec_len = 8 + len;
-			
+
 			if ((rec_len % 4) != 0)
 				rec_len += 4 - (rec_len % 4);
-			
+
 			memcpy(entry_buffer_ptr, dentry, rec_len);
-			
+
 			sort_array[idx].dentry = entry_buffer_ptr;
 			sort_array[idx].rec_len = rec_len;
 			sort_array[idx].hash = tmp_hinfo.hash;
-			
+
 			entry_buffer_ptr += rec_len;
 			real_size += rec_len;
 			idx++;
 		}
-		
+
 		dentry = (void *) dentry +
 		    ext4_directory_entry_ll_get_entry_length(dentry);
 	}
-	
+
 	/* Sort all entries */
 	qsort(sort_array, idx, sizeof(ext4_dx_sort_entry_t),
 	    ext4_directory_dx_entry_comparator);
-	
+
 	/* Allocate new block for store the second part of entries */
 	uint32_t new_fblock;
@@ -804,5 +804,5 @@
 		return rc;
 	}
-	
+
 	/* Load new block */
 	block_t *new_data_block_tmp;
@@ -814,5 +814,5 @@
 		return rc;
 	}
-	
+
 	/*
 	 * Distribute entries to two blocks (by size)
@@ -828,21 +828,21 @@
 			break;
 		}
-		
+
 		current_size += sort_array[i].rec_len;
 	}
-	
+
 	/* Check hash collision */
 	uint32_t continued = 0;
 	if (new_hash == sort_array[mid-1].hash)
 		continued = 1;
-	
+
 	uint32_t offset = 0;
 	void *ptr;
-	
+
 	/* First part - to the old block */
 	for (uint32_t i = 0; i < mid; ++i) {
 		ptr = old_data_block->data + offset;
 		memcpy(ptr, sort_array[i].dentry, sort_array[i].rec_len);
-		
+
 		ext4_directory_entry_ll_t *tmp = ptr;
 		if (i < (mid - 1))
@@ -852,8 +852,8 @@
 			ext4_directory_entry_ll_set_entry_length(tmp,
 			    block_size - offset);
-		
+
 		offset += sort_array[i].rec_len;
 	}
-	
+
 	/* Second part - to the new block */
 	offset = 0;
@@ -861,5 +861,5 @@
 		ptr = new_data_block_tmp->data + offset;
 		memcpy(ptr, sort_array[i].dentry, sort_array[i].rec_len);
-		
+
 		ext4_directory_entry_ll_t *tmp = ptr;
 		if (i < (idx - 1))
@@ -869,20 +869,20 @@
 			ext4_directory_entry_ll_set_entry_length(tmp,
 			    block_size - offset);
-		
+
 		offset += sort_array[i].rec_len;
 	}
-	
+
 	/* Do some steps to finish operation */
 	old_data_block->dirty = true;
 	new_data_block_tmp->dirty = true;
-	
+
 	free(sort_array);
 	free(entry_buffer);
-	
+
 	ext4_directory_dx_insert_entry(index_block, new_hash + continued,
 	    new_iblock);
-	
+
 	*new_data_block = new_data_block_tmp;
-	
+
 	return EOK;
 }
@@ -907,20 +907,20 @@
 		entries =
 		    ((ext4_directory_dx_node_t *) dx_block->block->data)->entries;
-	
+
 	ext4_directory_dx_countlimit_t *countlimit =
 	    (ext4_directory_dx_countlimit_t *) entries;
-	
+
 	uint16_t leaf_limit =
 	    ext4_directory_dx_countlimit_get_limit(countlimit);
 	uint16_t leaf_count =
 	    ext4_directory_dx_countlimit_get_count(countlimit);
-	
+
 	/* Check if is necessary to split index block */
 	if (leaf_limit == leaf_count) {
 		size_t levels = dx_block - dx_blocks;
-		
+
 		ext4_directory_dx_entry_t *root_entries =
 		    ((ext4_directory_dx_root_t *) dx_blocks[0].block->data)->entries;
-		
+
 		ext4_directory_dx_countlimit_t *root_countlimit =
 		    (ext4_directory_dx_countlimit_t *) root_entries;
@@ -929,9 +929,9 @@
 		uint16_t root_count =
 		    ext4_directory_dx_countlimit_get_count(root_countlimit);
-		
+
 		/* Linux limitation */
 		if ((levels > 0) && (root_limit == root_count))
 			return ENOSPC;
-		
+
 		/* Add new block to directory */
 		uint32_t new_fblock;
@@ -941,5 +941,5 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* load new block */
 		block_t *new_block;
@@ -948,11 +948,11 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_directory_dx_node_t *new_node = new_block->data;
 		ext4_directory_dx_entry_t *new_entries = new_node->entries;
-		
+
 		uint32_t block_size =
 		    ext4_superblock_get_block_size(inode_ref->fs->superblock);
-		
+
 		/* Split leaf node */
 		if (levels > 0) {
@@ -961,9 +961,9 @@
 			uint32_t hash_right =
 			    ext4_directory_dx_entry_get_hash(entries + count_left);
-			
+
 			/* Copy data to new node */
 			memcpy((void *) new_entries, (void *) (entries + count_left),
 			    count_right * sizeof(ext4_directory_dx_entry_t));
-			
+
 			/* Initialize new node */
 			ext4_directory_dx_countlimit_t *left_countlimit =
@@ -971,8 +971,8 @@
 			ext4_directory_dx_countlimit_t *right_countlimit =
 			    (ext4_directory_dx_countlimit_t *) new_entries;
-			
+
 			ext4_directory_dx_countlimit_set_count(left_countlimit, count_left);
 			ext4_directory_dx_countlimit_set_count(right_countlimit, count_right);
-			
+
 			uint32_t entry_space =
 			    block_size - sizeof(ext4_fake_directory_entry_t);
@@ -980,10 +980,10 @@
 			    entry_space / sizeof(ext4_directory_dx_entry_t);
 			ext4_directory_dx_countlimit_set_limit(right_countlimit, node_limit);
-			
+
 			/* Which index block is target for new entry */
 			uint32_t position_index = (dx_block->position - dx_block->entries);
 			if (position_index >= count_left) {
 				dx_block->block->dirty = true;
-				
+
 				block_t *block_tmp = dx_block->block;
 				dx_block->block = new_block;
@@ -991,22 +991,22 @@
 				    new_entries + position_index - count_left;
 				dx_block->entries = new_entries;
-				
+
 				new_block = block_tmp;
 			}
-			
+
 			/* Finally insert new entry */
 			ext4_directory_dx_insert_entry(dx_blocks, hash_right, new_iblock);
-			
+
 			return block_put(new_block);
 		} else {
 			/* Create second level index */
-			
+
 			/* Copy data from root to child block */
 			memcpy((void *) new_entries, (void *) entries,
 			    leaf_count * sizeof(ext4_directory_dx_entry_t));
-			
+
 			ext4_directory_dx_countlimit_t *new_countlimit =
 			    (ext4_directory_dx_countlimit_t *) new_entries;
-			
+
 			uint32_t entry_space =
 			    block_size - sizeof(ext4_fake_directory_entry_t);
@@ -1014,15 +1014,15 @@
 			    entry_space / sizeof(ext4_directory_dx_entry_t);
 			ext4_directory_dx_countlimit_set_limit(new_countlimit, node_limit);
-			
+
 			/* Set values in root node */
 			ext4_directory_dx_countlimit_t *new_root_countlimit =
 			    (ext4_directory_dx_countlimit_t *) entries;
-			
+
 			ext4_directory_dx_countlimit_set_count(new_root_countlimit, 1);
 			ext4_directory_dx_entry_set_block(entries, new_iblock);
-			
+
 			((ext4_directory_dx_root_t *)
 			    dx_blocks[0].block->data)->info.indirect_levels = 1;
-			
+
 			/* Add new entry to the path */
 			dx_block = dx_blocks + 1;
@@ -1032,5 +1032,5 @@
 		}
 	}
-	
+
 	return EOK;
 }
@@ -1049,5 +1049,5 @@
 {
 	errno_t rc2 = EOK;
-	
+
 	/* Get direct block 0 (index root) */
 	uint32_t root_block_addr;
@@ -1056,7 +1056,7 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	ext4_filesystem_t *fs = parent->fs;
-	
+
 	block_t *root_block;
 	rc = block_get(&root_block, fs->device, root_block_addr,
@@ -1064,5 +1064,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Initialize hinfo structure (mainly compute hash) */
 	uint32_t name_len = str_size(name);
@@ -1074,5 +1074,5 @@
 		return EXT4_ERR_BAD_DX_DIR;
 	}
-	
+
 	/*
 	 * Hardcoded number 2 means maximum height of index
@@ -1082,5 +1082,5 @@
 	ext4_directory_dx_block_t *dx_block;
 	ext4_directory_dx_block_t *dx_it;
-	
+
 	rc = ext4_directory_dx_get_leaf(&hinfo, parent, root_block,
 	    &dx_block, dx_blocks);
@@ -1089,5 +1089,5 @@
 		goto release_index;
 	}
-	
+
 	/* Try to insert to existing data block */
 	uint32_t leaf_block_idx =
@@ -1098,5 +1098,5 @@
 	if (rc != EOK)
 		goto release_index;
-	
+
 	block_t *target_block;
 	rc = block_get(&target_block, fs->device, leaf_block_addr,
@@ -1104,5 +1104,5 @@
 	if (rc != EOK)
 		goto release_index;
-	
+
 	/* Check if insert operation passed */
 	rc = ext4_directory_try_insert_entry(fs->superblock, target_block, child,
@@ -1110,5 +1110,5 @@
 	if (rc == EOK)
 		goto release_target_index;
-	
+
 	/*
 	 * Check if there is needed to split index node
@@ -1118,5 +1118,5 @@
 	if (rc != EOK)
 		goto release_target_index;
-	
+
 	/* Split entries to two blocks (includes sorting by hash value) */
 	block_t *new_block = NULL;
@@ -1127,5 +1127,5 @@
 		goto release_target_index;
 	}
-	
+
 	/* Where to save new entry */
 	uint32_t new_block_hash =
@@ -1137,33 +1137,33 @@
 		rc = ext4_directory_try_insert_entry(fs->superblock, target_block,
 		    child, name, name_len);
-	
+
 	/* Cleanup */
 	rc = block_put(new_block);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Cleanup operations */
-	
+
 release_target_index:
 	rc2 = rc;
-	
+
 	rc = block_put(target_block);
 	if (rc != EOK)
 		return rc;
-	
+
 release_index:
 	if (rc != EOK)
 		rc2 = rc;
-	
+
 	dx_it = dx_blocks;
-	
+
 	while (dx_it <= dx_block) {
 		rc = block_put(dx_it->block);
 		if (rc != EOK)
 			return rc;
-		
+
 		dx_it++;
 	}
-	
+
 	return rc2;
 }
Index: uspace/lib/ext4/src/extent.c
===================================================================
--- uspace/lib/ext4/src/extent.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/extent.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -295,17 +295,17 @@
 	ext4_extent_index_t *l;
 	ext4_extent_index_t *m;
-	
+
 	uint16_t entries_count =
 	    ext4_extent_header_get_entries_count(header);
-	
+
 	/* Initialize bounds */
 	l = EXT4_EXTENT_FIRST_INDEX(header) + 1;
 	r = EXT4_EXTENT_FIRST_INDEX(header) + entries_count - 1;
-	
+
 	/* Do binary search */
 	while (l <= r) {
 		m = l + (r - l) / 2;
 		uint32_t first_block = ext4_extent_index_get_first_block(m);
-		
+
 		if (iblock < first_block)
 			r = m - 1;
@@ -313,5 +313,5 @@
 			l = m + 1;
 	}
-	
+
 	/* Set output value */
 	*index = l - 1;
@@ -332,8 +332,8 @@
 	ext4_extent_t *l;
 	ext4_extent_t *m;
-	
+
 	uint16_t entries_count =
 	    ext4_extent_header_get_entries_count(header);
-	
+
 	if (entries_count == 0) {
 		/* this leaf is empty */
@@ -341,14 +341,14 @@
 		return;
 	}
-	
+
 	/* Initialize bounds */
 	l = EXT4_EXTENT_FIRST(header) + 1;
 	r = EXT4_EXTENT_FIRST(header) + entries_count - 1;
-	
+
 	/* Do binary search */
 	while (l <= r) {
 		m = l + (r - l) / 2;
 		uint32_t first_block = ext4_extent_get_first_block(m);
-		
+
 		if (iblock < first_block)
 			r = m - 1;
@@ -356,5 +356,5 @@
 			l = m + 1;
 	}
-	
+
 	/* Set output value */
 	*extent = l - 1;
@@ -379,10 +379,10 @@
 	uint64_t inode_size =
 	    ext4_inode_get_size(inode_ref->fs->superblock, inode_ref->inode);
-	
+
 	uint32_t block_size =
 	    ext4_superblock_get_block_size(inode_ref->fs->superblock);
-	
+
 	uint32_t last_idx = (inode_size - 1) / block_size;
-	
+
 	/* Check if requested iblock is not over size of i-node */
 	if (iblock > last_idx) {
@@ -390,19 +390,19 @@
 		return EOK;
 	}
-	
+
 	block_t *block = NULL;
-	
+
 	/* Walk through extent tree */
 	ext4_extent_header_t *header =
 	    ext4_inode_get_extent_header(inode_ref->inode);
-	
+
 	while (ext4_extent_header_get_depth(header) != 0) {
 		/* Search index in node */
 		ext4_extent_index_t *index;
 		ext4_extent_binsearch_idx(header, &index, iblock);
-		
+
 		/* Load child node and set values for the next iteration */
 		uint64_t child = ext4_extent_index_get_leaf(index);
-		
+
 		if (block != NULL) {
 			rc = block_put(block);
@@ -410,17 +410,17 @@
 				return rc;
 		}
-		
+
 		rc = block_get(&block, inode_ref->fs->device, child,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
 			return rc;
-		
+
 		header = (ext4_extent_header_t *)block->data;
 	}
-	
+
 	/* Search extent in the leaf block */
 	ext4_extent_t* extent = NULL;
 	ext4_extent_binsearch(header, &extent, iblock);
-	
+
 	/* Prevent empty leaf */
 	if (extent == NULL) {
@@ -431,12 +431,12 @@
 		uint32_t first = ext4_extent_get_first_block(extent);
 		phys_block = ext4_extent_get_start(extent) + iblock - first;
-		
+
 		*fblock = phys_block;
 	}
-	
+
 	/* Cleanup */
 	if (block != NULL)
 		rc = block_put(block);
-	
+
 	return rc;
 }
@@ -459,18 +459,18 @@
 	ext4_extent_header_t *eh =
 	    ext4_inode_get_extent_header(inode_ref->inode);
-	
+
 	uint16_t depth = ext4_extent_header_get_depth(eh);
-	
+
 	ext4_extent_path_t *tmp_path;
-	
+
 	/* Added 2 for possible tree growing */
 	tmp_path = malloc(sizeof(ext4_extent_path_t) * (depth + 2));
 	if (tmp_path == NULL)
 		return ENOMEM;
-	
+
 	/* Initialize structure for algorithm start */
 	tmp_path[0].block = inode_ref->block;
 	tmp_path[0].header = eh;
-	
+
 	/* Walk through the extent tree */
 	uint16_t pos = 0;
@@ -480,13 +480,13 @@
 		ext4_extent_binsearch_idx(tmp_path[pos].header,
 		    &tmp_path[pos].index, iblock);
-		
+
 		tmp_path[pos].depth = depth;
 		tmp_path[pos].extent = NULL;
-		
+
 		assert(tmp_path[pos].index != NULL);
-		
+
 		/* Load information for the next iteration */
 		uint64_t fblock = ext4_extent_index_get_leaf(tmp_path[pos].index);
-		
+
 		block_t *block;
 		rc = block_get(&block, inode_ref->fs->device, fblock,
@@ -494,22 +494,22 @@
 		if (rc != EOK)
 			goto cleanup;
-		
+
 		pos++;
-		
+
 		eh = (ext4_extent_header_t *)block->data;
 		tmp_path[pos].block = block;
 		tmp_path[pos].header = eh;
 	}
-	
+
 	tmp_path[pos].depth = 0;
 	tmp_path[pos].extent = NULL;
 	tmp_path[pos].index = NULL;
-	
+
 	/* Find extent in the leaf node */
 	ext4_extent_binsearch(tmp_path[pos].header, &tmp_path[pos].extent, iblock);
 	*ret_path = tmp_path;
-	
+
 	return EOK;
-	
+
 cleanup:
 	;
@@ -528,8 +528,8 @@
 		}
 	}
-	
+
 	/* Destroy temporary data structure */
 	free(tmp_path);
-	
+
 	return rc;
 }
@@ -549,5 +549,5 @@
 	uint64_t start = ext4_extent_get_start(extent);
 	uint16_t block_count = ext4_extent_get_block_count(extent);
-	
+
 	return ext4_balloc_free_blocks(inode_ref, start, block_count);
 }
@@ -569,16 +569,16 @@
 {
 	uint32_t fblock = ext4_extent_index_get_leaf(index);
-	
+
 	block_t* block;
 	errno_t rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NONE);
 	if (rc != EOK)
 		return rc;
-	
+
 	ext4_extent_header_t *header = block->data;
-	
+
 	if (ext4_extent_header_get_depth(header)) {
 		/* The node is non-leaf, do recursion */
 		ext4_extent_index_t *idx = EXT4_EXTENT_FIRST_INDEX(header);
-		
+
 		/* Release all subbranches */
 		for (uint32_t i = 0;
@@ -592,5 +592,5 @@
 		/* Leaf node reached */
 		ext4_extent_t *ext = EXT4_EXTENT_FIRST(header);
-		
+
 		/* Release all extents and stop recursion */
 		for (uint32_t i = 0;
@@ -602,11 +602,11 @@
 		}
 	}
-	
+
 	/* Release data block where the node was stored */
-	
+
 	rc = block_put(block);
 	if (rc != EOK)
 		return rc;
-	
+
 	return ext4_balloc_free_block(inode_ref, fblock);
 }
@@ -626,12 +626,12 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Jump to last item of the path (extent) */
 	ext4_extent_path_t *path_ptr = path;
 	while (path_ptr->depth != 0)
 		path_ptr++;
-	
+
 	assert(path_ptr->extent != NULL);
-	
+
 	/* First extent maybe released partially */
 	uint32_t first_iblock =
@@ -639,19 +639,19 @@
 	uint32_t first_fblock =
 	    ext4_extent_get_start(path_ptr->extent) + iblock_from - first_iblock;
-	
+
 	uint16_t block_count = ext4_extent_get_block_count(path_ptr->extent);
-	
+
 	uint16_t delete_count = block_count -
 	    (ext4_extent_get_start(path_ptr->extent) - first_fblock);
-	
+
 	/* Release all blocks */
 	rc = ext4_balloc_free_blocks(inode_ref, first_fblock, delete_count);
 	if (rc != EOK)
 		goto cleanup;
-	
+
 	/* Correct counter */
 	block_count -= delete_count;
 	ext4_extent_set_block_count(path_ptr->extent, block_count);
-	
+
 	/* Initialize the following loop */
 	uint16_t entries =
@@ -659,28 +659,28 @@
 	ext4_extent_t *tmp_ext = path_ptr->extent + 1;
 	ext4_extent_t *stop_ext = EXT4_EXTENT_FIRST(path_ptr->header) + entries;
-	
+
 	/* If first extent empty, release it */
 	if (block_count == 0)
 		entries--;
-	
+
 	/* Release all successors of the first extent in the same node */
 	while (tmp_ext < stop_ext) {
 		first_fblock = ext4_extent_get_start(tmp_ext);
 		delete_count = ext4_extent_get_block_count(tmp_ext);
-		
+
 		rc = ext4_balloc_free_blocks(inode_ref, first_fblock, delete_count);
 		if (rc != EOK)
 			goto cleanup;
-		
+
 		entries--;
 		tmp_ext++;
 	}
-	
+
 	ext4_extent_header_set_entries_count(path_ptr->header, entries);
 	path_ptr->block->dirty = true;
-	
+
 	/* If leaf node is empty, parent entry must be modified */
 	bool remove_parent_record = false;
-	
+
 	/* Don't release root block (including inode data) !!! */
 	if ((path_ptr != path) && (entries == 0)) {
@@ -688,11 +688,11 @@
 		if (rc != EOK)
 			goto cleanup;
-		
+
 		remove_parent_record = true;
 	}
-	
+
 	/* Jump to the parent */
 	--path_ptr;
-	
+
 	/* Release all successors in all tree levels */
 	while (path_ptr >= path) {
@@ -701,9 +701,9 @@
 		ext4_extent_index_t *stop =
 		    EXT4_EXTENT_FIRST_INDEX(path_ptr->header) + entries;
-		
+
 		/* Correct entries count because of changes in the previous iteration */
 		if (remove_parent_record)
 			entries--;
-		
+
 		/* Iterate over all entries and release the whole subtrees */
 		while (index < stop) {
@@ -711,12 +711,12 @@
 			if (rc != EOK)
 				goto cleanup;
-			
+
 			++index;
 			--entries;
 		}
-		
+
 		ext4_extent_header_set_entries_count(path_ptr->header, entries);
 		path_ptr->block->dirty = true;
-		
+
 		/* Free the node if it is empty */
 		if ((entries == 0) && (path_ptr != path)) {
@@ -724,13 +724,13 @@
 			if (rc != EOK)
 				goto cleanup;
-			
+
 			/* Mark parent to be checked */
 			remove_parent_record = true;
 		} else
 			remove_parent_record = false;
-		
+
 		--path_ptr;
 	}
-	
+
 cleanup:
 	;
@@ -749,8 +749,8 @@
 		}
 	}
-	
+
 	/* Destroy temporary data structure */
 	free(path);
-	
+
 	return rc;
 }
@@ -771,8 +771,8 @@
 {
 	ext4_extent_path_t *path_ptr = path + path->depth;
-	
+
 	uint32_t block_size =
 	    ext4_superblock_get_block_size(inode_ref->fs->superblock);
-	
+
 	/* Start splitting */
 	while (path_ptr > path) {
@@ -781,5 +781,5 @@
 		uint16_t limit =
 		    ext4_extent_header_get_max_entries_count(path_ptr->header);
-		
+
 		if (entries == limit) {
 			/* Full node - allocate block for new one */
@@ -788,5 +788,5 @@
 			if (rc != EOK)
 				return rc;
-			
+
 			block_t *block;
 			rc = block_get(&block, inode_ref->fs->device, fblock,
@@ -796,5 +796,5 @@
 				return rc;
 			}
-			
+
 			/* Put back not modified old block */
 			rc = block_put(path_ptr->block);
@@ -804,9 +804,9 @@
 				return rc;
 			}
-			
+
 			/* Initialize newly allocated block and remember it */
 			memset(block->data, 0, block_size);
 			path_ptr->block = block;
-			
+
 			/* Update pointers in extent path structure */
 			path_ptr->header = block->data;
@@ -823,5 +823,5 @@
 				    sizeof(ext4_extent_t);
 			}
-			
+
 			/* Initialize on-disk structure (header) */
 			ext4_extent_header_set_entries_count(path_ptr->header, 1);
@@ -830,7 +830,7 @@
 			ext4_extent_header_set_depth(path_ptr->header, path_ptr->depth);
 			ext4_extent_header_set_generation(path_ptr->header, 0);
-			
+
 			path_ptr->block->dirty = true;
-			
+
 			/* Jump to the preceeding item */
 			path_ptr--;
@@ -845,20 +845,20 @@
 				ext4_extent_set_first_block(path_ptr->extent, iblock);
 			}
-			
+
 			ext4_extent_header_set_entries_count(path_ptr->header, entries + 1);
 			path_ptr->block->dirty = true;
-			
+
 			/* No more splitting needed */
 			return EOK;
 		}
 	}
-	
+
 	assert(path_ptr == path);
-	
+
 	/* Should be the root split too? */
-	
+
 	uint16_t entries = ext4_extent_header_get_entries_count(path->header);
 	uint16_t limit = ext4_extent_header_get_max_entries_count(path->header);
-	
+
 	if (entries == limit) {
 		uint32_t new_fblock;
@@ -866,5 +866,5 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		block_t *block;
 		rc = block_get(&block, inode_ref->fs->device, new_fblock,
@@ -872,30 +872,30 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Initialize newly allocated block */
 		memset(block->data, 0, block_size);
-		
+
 		/* Move data from root to the new block */
 		memcpy(block->data, inode_ref->inode->blocks,
 		    EXT4_INODE_BLOCKS * sizeof(uint32_t));
-		
+
 		/* Data block is initialized */
-		
+
 		block_t *root_block = path->block;
 		uint16_t root_depth = path->depth;
 		ext4_extent_header_t *root_header = path->header;
-		
+
 		/* Make space for tree growing */
 		ext4_extent_path_t *new_root = path;
 		ext4_extent_path_t *old_root = path + 1;
-		
+
 		size_t nbytes = sizeof(ext4_extent_path_t) * (path->depth + 1);
 		memmove(old_root, new_root, nbytes);
 		memset(new_root, 0, sizeof(ext4_extent_path_t));
-		
+
 		/* Update old root structure */
 		old_root->block = block;
 		old_root->header = (ext4_extent_header_t *)block->data;
-		
+
 		/* Add new entry and update limit for entries */
 		if (old_root->depth) {
@@ -913,10 +913,10 @@
 			old_root->index = NULL;
 		}
-		
+
 		ext4_extent_header_set_entries_count(old_root->header, entries + 1);
 		ext4_extent_header_set_max_entries_count(old_root->header, limit);
-		
+
 		old_root->block->dirty = true;
-		
+
 		/* Re-initialize new root metadata */
 		new_root->depth = root_depth + 1;
@@ -925,12 +925,12 @@
 		new_root->extent = NULL;
 		new_root->index = EXT4_EXTENT_FIRST_INDEX(new_root->header);
-		
+
 		ext4_extent_header_set_depth(new_root->header, new_root->depth);
-		
+
 		/* Create new entry in root */
 		ext4_extent_header_set_entries_count(new_root->header, 1);
 		ext4_extent_index_set_first_block(new_root->index, 0);
 		ext4_extent_index_set_leaf(new_root->index, new_fblock);
-		
+
 		new_root->block->dirty = true;
 	} else {
@@ -943,9 +943,9 @@
 			ext4_extent_set_first_block(path->extent, iblock);
 		}
-		
+
 		ext4_extent_header_set_entries_count(path->header, entries + 1);
 		path->block->dirty = true;
 	}
-	
+
 	return EOK;
 }
@@ -970,5 +970,5 @@
 	uint64_t inode_size = ext4_inode_get_size(sb, inode_ref->inode);
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
-	
+
 	/* Calculate number of new logical block */
 	uint32_t new_block_idx = 0;
@@ -976,8 +976,8 @@
 		if ((inode_size % block_size) != 0)
 			inode_size += block_size - (inode_size % block_size);
-		
+
 		new_block_idx = inode_size / block_size;
 	}
-	
+
 	/* Load the nearest leaf (with extent) */
 	ext4_extent_path_t *path;
@@ -985,17 +985,17 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Jump to last item of the path (extent) */
 	ext4_extent_path_t *path_ptr = path;
 	while (path_ptr->depth != 0)
 		path_ptr++;
-	
+
 	/* Add new extent to the node if not present */
 	if (path_ptr->extent == NULL)
 		goto append_extent;
-	
+
 	uint16_t block_count = ext4_extent_get_block_count(path_ptr->extent);
 	uint16_t block_limit = (1 << 15);
-	
+
 	uint32_t phys_block = 0;
 	if (block_count < block_limit) {
@@ -1006,10 +1006,10 @@
 			if (rc != EOK)
 				goto finish;
-			
+
 			/* Initialize extent */
 			ext4_extent_set_first_block(path_ptr->extent, new_block_idx);
 			ext4_extent_set_start(path_ptr->extent, phys_block);
 			ext4_extent_set_block_count(path_ptr->extent, 1);
-			
+
 			/* Update i-node */
 			if (update_size) {
@@ -1017,7 +1017,7 @@
 				inode_ref->dirty = true;
 			}
-			
+
 			path_ptr->block->dirty = true;
-			
+
 			goto finish;
 		} else {
@@ -1025,5 +1025,5 @@
 			phys_block = ext4_extent_get_start(path_ptr->extent);
 			phys_block += ext4_extent_get_block_count(path_ptr->extent);
-			
+
 			/* Check if the following block is free for allocation */
 			bool free;
@@ -1031,13 +1031,13 @@
 			if (rc != EOK)
 				goto finish;
-			
+
 			if (!free) {
 				/* Target is not free, new block must be appended to new extent */
 				goto append_extent;
 			}
-			
+
 			/* Update extent */
 			ext4_extent_set_block_count(path_ptr->extent, block_count + 1);
-			
+
 			/* Update i-node */
 			if (update_size) {
@@ -1045,21 +1045,21 @@
 				inode_ref->dirty = true;
 			}
-			
+
 			path_ptr->block->dirty = true;
-			
+
 			goto finish;
 		}
 	}
-	
-	
+
+
 append_extent:
 	/* Append new extent to the tree */
 	phys_block = 0;
-	
+
 	/* Allocate new data block */
 	rc = ext4_balloc_alloc_block(inode_ref, &phys_block);
 	if (rc != EOK)
 		goto finish;
-	
+
 	/* Append extent for new block (includes tree splitting if needed) */
 	rc = ext4_extent_append_extent(inode_ref, path, new_block_idx);
@@ -1068,13 +1068,13 @@
 		goto finish;
 	}
-	
+
 	uint32_t tree_depth = ext4_extent_header_get_depth(path->header);
 	path_ptr = path + tree_depth;
-	
+
 	/* Initialize newly created extent */
 	ext4_extent_set_block_count(path_ptr->extent, 1);
 	ext4_extent_set_first_block(path_ptr->extent, new_block_idx);
 	ext4_extent_set_start(path_ptr->extent, phys_block);
-	
+
 	/* Update i-node */
 	if (update_size) {
@@ -1082,7 +1082,7 @@
 		inode_ref->dirty = true;
 	}
-	
+
 	path_ptr->block->dirty = true;
-	
+
 finish:
 	;
@@ -1093,5 +1093,5 @@
 	*iblock = new_block_idx;
 	*fblock = phys_block;
-	
+
 	/*
 	 * Put loaded blocks
@@ -1105,8 +1105,8 @@
 		}
 	}
-	
+
 	/* Destroy temporary data structure */
 	free(path);
-	
+
 	return rc;
 }
Index: uspace/lib/ext4/src/filesystem.c
===================================================================
--- uspace/lib/ext4/src/filesystem.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/filesystem.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -289,5 +289,5 @@
 		return EOK;
 	}
-	
+
 	/*
 	 * Check incompatible features - if filesystem has some,
@@ -300,5 +300,5 @@
 	if (incompatible_features > 0)
 		return ENOTSUP;
-	
+
 	/*
 	 * Check read-only features, if filesystem has some,
@@ -313,5 +313,5 @@
 		return EOK;
 	}
-	
+
 	return EOK;
 }
@@ -331,5 +331,5 @@
 	uint32_t blocks_per_group = ext4_superblock_get_blocks_per_group(sb);
 	uint32_t first_block = ext4_superblock_get_first_data_block(sb);
-	
+
 	/* First block == 0 or 1 */
 	if (first_block == 0)
@@ -351,5 +351,5 @@
 {
 	uint32_t blocks_per_group = ext4_superblock_get_blocks_per_group(sb);
-	
+
 	if (ext4_superblock_get_first_data_block(sb) == 0)
 		return bgid * blocks_per_group + index;
@@ -392,5 +392,5 @@
 	uint64_t bitmap_inode_addr = ext4_block_group_get_inode_bitmap(
 	    bg_ref->block_group, bg_ref->fs->superblock);
-	
+
 	block_t *bitmap_block;
 	errno_t rc = block_get(&bitmap_block, bg_ref->fs->device,
@@ -398,11 +398,11 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	uint8_t *bitmap = bitmap_block->data;
-	
+
 	/* Initialize all bitmap bits to zero */
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
 	memset(bitmap, 0, block_size);
-	
+
 	/* Determine the number of reserved blocks in the group */
 	uint32_t reserved_cnt = ext4_filesystem_bg_get_backup_blocks(bg_ref);
@@ -439,5 +439,5 @@
 
 	bitmap_block->dirty = true;
-	
+
 	/* Save bitmap */
 	return block_put(bitmap_block);
@@ -457,12 +457,12 @@
 	    bg_ref->block_group, bg_ref->fs->superblock);
 	block_t *bitmap_block;
-	
+
 	errno_t rc = block_get(&bitmap_block, bg_ref->fs->device,
 	    bitmap_block_addr, BLOCK_FLAGS_NOREAD);
 	if (rc != EOK)
 		return rc;
-	
+
 	uint8_t *bitmap = bitmap_block->data;
-	
+
 	/* Initialize all bitmap bits to zero */
 	uint32_t block_size = ext4_superblock_get_block_size(bg_ref->fs->superblock);
@@ -470,17 +470,17 @@
 	    ext4_superblock_get_inodes_per_group(bg_ref->fs->superblock);
 	memset(bitmap, 0, (inodes_per_group + 7) / 8);
-	
+
 	uint32_t start_bit = inodes_per_group;
 	uint32_t end_bit = block_size * 8;
-	
+
 	uint32_t i;
 	for (i = start_bit; i < ((start_bit + 7) & ~7UL); i++)
 		ext4_bitmap_set_bit(bitmap, i);
-	
+
 	if (i < end_bit)
 		memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
-	
+
 	bitmap_block->dirty = true;
-	
+
 	/* Save bitmap */
 	return block_put(bitmap_block);
@@ -497,23 +497,23 @@
 {
 	ext4_superblock_t *sb = bg_ref->fs->superblock;
-	
+
 	uint32_t inode_size = ext4_superblock_get_inode_size(sb);
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
 	uint32_t inodes_per_block = block_size / inode_size;
-	
+
 	uint32_t inodes_in_group =
 	    ext4_superblock_get_inodes_in_group(sb, bg_ref->index);
-	
+
 	uint32_t table_blocks = inodes_in_group / inodes_per_block;
-	
+
 	if (inodes_in_group % inodes_per_block)
 		table_blocks++;
-	
+
 	/* Compute initialization bounds */
 	uint32_t first_block = ext4_block_group_get_inode_table_first_block(
 	    bg_ref->block_group, sb);
-	
+
 	uint32_t last_block = first_block + table_blocks - 1;
-	
+
 	/* Initialization of all itable blocks */
 	for (uint32_t fblock = first_block; fblock <= last_block; ++fblock) {
@@ -523,13 +523,13 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		memset(block->data, 0, block_size);
 		block->dirty = true;
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
 	}
-	
+
 	return EOK;
 }
@@ -552,19 +552,19 @@
 	if (newref == NULL)
 		return ENOMEM;
-	
+
 	/* Compute number of descriptors, that fits in one data block */
 	uint32_t descriptors_per_block =
 	    ext4_superblock_get_block_size(fs->superblock) /
 	    ext4_superblock_get_desc_size(fs->superblock);
-	
+
 	/* Block group descriptor table starts at the next block after superblock */
 	aoff64_t block_id =
 	    ext4_superblock_get_first_data_block(fs->superblock) + 1;
-	
+
 	/* Find the block containing the descriptor we are looking for */
 	block_id += bgid / descriptors_per_block;
 	uint32_t offset = (bgid % descriptors_per_block) *
 	    ext4_superblock_get_desc_size(fs->superblock);
-	
+
 	/* Load block with descriptors */
 	errno_t rc = block_get(&newref->block, fs->device, block_id, 0);
@@ -573,5 +573,5 @@
 		return rc;
 	}
-	
+
 	/* Initialize in-memory representation */
 	newref->block_group = newref->block->data + offset;
@@ -579,7 +579,7 @@
 	newref->index = bgid;
 	newref->dirty = false;
-	
+
 	*ref = newref;
-	
+
 	if (ext4_block_group_has_flag(newref->block_group,
 	    EXT4_BLOCK_GROUP_BLOCK_UNINIT)) {
@@ -590,11 +590,11 @@
 			return rc;
 		}
-		
+
 		ext4_block_group_clear_flag(newref->block_group,
 		    EXT4_BLOCK_GROUP_BLOCK_UNINIT);
-		
+
 		newref->dirty = true;
 	}
-	
+
 	if (ext4_block_group_has_flag(newref->block_group,
 	    EXT4_BLOCK_GROUP_INODE_UNINIT)) {
@@ -605,8 +605,8 @@
 			return rc;
 		}
-		
+
 		ext4_block_group_clear_flag(newref->block_group,
 		    EXT4_BLOCK_GROUP_INODE_UNINIT);
-		
+
 		if (!ext4_block_group_has_flag(newref->block_group,
 		    EXT4_BLOCK_GROUP_ITABLE_ZEROED)) {
@@ -614,12 +614,12 @@
 			if (rc != EOK)
 				return rc;
-			
+
 			ext4_block_group_set_flag(newref->block_group,
 			    EXT4_BLOCK_GROUP_ITABLE_ZEROED);
 		}
-		
+
 		newref->dirty = true;
 	}
-	
+
 	return EOK;
 }
@@ -645,22 +645,22 @@
 		void *base = bg;
 		void *checksum = &bg->checksum;
-		
+
 		uint32_t offset = (uint32_t) (checksum - base);
-		
+
 		/* Convert block group index to little endian */
 		uint32_t le_group = host2uint32_t_le(bgid);
-		
+
 		/* Initialization */
 		crc = crc16_ibm(~0, sb->uuid, sizeof(sb->uuid));
-		
+
 		/* Include index of block group */
 		crc = crc16_ibm(crc, (uint8_t *) &le_group, sizeof(le_group));
-		
+
 		/* Compute crc from the first part (stop before checksum field) */
 		crc = crc16_ibm(crc, (uint8_t *) bg, offset);
-		
+
 		/* Skip checksum */
 		offset += sizeof(bg->checksum);
-		
+
 		/* Checksum of the rest of block group descriptor */
 		if ((ext4_superblock_has_feature_incompatible(sb,
@@ -670,5 +670,5 @@
 			    ext4_superblock_get_desc_size(sb) - offset);
 	}
-	
+
 	return crc;
 }
@@ -813,13 +813,13 @@
 		    ref->block_group);
 		ext4_block_group_set_checksum(ref->block_group, checksum);
-		
+
 		/* Mark block dirty for writing changes to physical device */
 		ref->block->dirty = true;
 	}
-	
+
 	/* Put back block, that contains block group descriptor */
 	errno_t rc = block_put(ref->block);
 	free(ref);
-	
+
 	return rc;
 }
@@ -842,9 +842,9 @@
 	if (newref == NULL)
 		return ENOMEM;
-	
+
 	/* Compute number of i-nodes, that fits in one data block */
 	uint32_t inodes_per_group =
 	    ext4_superblock_get_inodes_per_group(fs->superblock);
-	
+
 	/*
 	 * Inode numbers are 1-based, but it is simpler to work with 0-based
@@ -854,5 +854,5 @@
 	uint32_t block_group = index / inodes_per_group;
 	uint32_t offset_in_group = index % inodes_per_group;
-	
+
 	/* Load block group, where i-node is located */
 	ext4_block_group_ref_t *bg_ref;
@@ -862,10 +862,10 @@
 		return rc;
 	}
-	
+
 	/* Load block address, where i-node table is located */
 	uint32_t inode_table_start =
 	    ext4_block_group_get_inode_table_first_block(bg_ref->block_group,
 	    fs->superblock);
-	
+
 	/* Put back block group reference (not needed more) */
 	rc = ext4_filesystem_put_block_group_ref(bg_ref);
@@ -874,10 +874,10 @@
 		return rc;
 	}
-	
+
 	/* Compute position of i-node in the block group */
 	uint16_t inode_size = ext4_superblock_get_inode_size(fs->superblock);
 	uint32_t block_size = ext4_superblock_get_block_size(fs->superblock);
 	uint32_t byte_offset_in_group = offset_in_group * inode_size;
-	
+
 	/* Compute block address */
 	aoff64_t block_id = inode_table_start + (byte_offset_in_group / block_size);
@@ -887,16 +887,16 @@
 		return rc;
 	}
-	
+
 	/* Compute position of i-node in the data block */
 	uint32_t offset_in_block = byte_offset_in_group % block_size;
 	newref->inode = newref->block->data + offset_in_block;
-	
+
 	/* We need to store the original value of index in the reference */
 	newref->index = index + 1;
 	newref->fs = fs;
 	newref->dirty = false;
-	
+
 	*ref = newref;
-	
+
 	return EOK;
 }
@@ -916,9 +916,9 @@
 		ref->block->dirty = true;
 	}
-	
+
 	/* Put back block, that contains i-node */
 	errno_t rc = block_put(ref->block);
 	free(ref);
-	
+
 	return rc;
 }
@@ -940,5 +940,5 @@
 	if (flags & L_DIRECTORY)
 		is_dir = true;
-	
+
 	/* Allocate inode by allocation algorithm */
 	uint32_t index;
@@ -946,5 +946,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Load i-node from on-disk i-node table */
 	rc = ext4_filesystem_get_inode_ref(fs, index, inode_ref);
@@ -953,8 +953,8 @@
 		return rc;
 	}
-	
+
 	/* Initialize i-node */
 	ext4_inode_t *inode = (*inode_ref)->inode;
-	
+
 	uint16_t mode;
 	if (is_dir) {
@@ -963,5 +963,5 @@
 		 * 0777 (octal) == rwxrwxrwx
 		 */
-		
+
 		mode = 0777;
 		mode |= EXT4_INODE_MODE_DIRECTORY;
@@ -973,5 +973,5 @@
 		 * 0666 (octal) == rw-rw-rw-
 		 */
-		
+
 		mode = 0666;
 		mode |= EXT4_INODE_MODE_FILE;
@@ -979,5 +979,5 @@
 		ext4_inode_set_links_count(inode, 0);
 	}
-	
+
 	ext4_inode_set_uid(inode, 0);
 	ext4_inode_set_gid(inode, 0);
@@ -990,14 +990,14 @@
 	ext4_inode_set_flags(inode, 0);
 	ext4_inode_set_generation(inode, 0);
-	
+
 	/* Reset blocks array */
 	for (uint32_t i = 0; i < EXT4_INODE_BLOCKS; i++)
 		inode->blocks[i] = 0;
-	
+
 	/* Initialize extents if needed */
 	if (ext4_superblock_has_feature_incompatible(
 	    fs->superblock, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
 		ext4_inode_set_flag(inode, EXT4_INODE_FLAG_EXTENTS);
-		
+
 		/* Initialize extent root header */
 		ext4_extent_header_t *header = ext4_inode_get_extent_header(inode);
@@ -1006,13 +1006,13 @@
 		ext4_extent_header_set_generation(header, 0);
 		ext4_extent_header_set_magic(header, EXT4_EXTENT_MAGIC);
-		
+
 		uint16_t max_entries = (EXT4_INODE_BLOCKS * sizeof(uint32_t) -
 		    sizeof(ext4_extent_header_t)) / sizeof(ext4_extent_t);
-		
+
 		ext4_extent_header_set_max_entries_count(header, max_entries);
 	}
-	
+
 	(*inode_ref)->dirty = true;
-	
+
 	return EOK;
 }
@@ -1028,5 +1028,5 @@
 {
 	ext4_filesystem_t *fs = inode_ref->fs;
-	
+
 	/* For extents must be data block destroyed by other way */
 	if ((ext4_superblock_has_feature_incompatible(fs->superblock,
@@ -1036,7 +1036,7 @@
 		goto finish;
 	}
-	
+
 	/* Release all indirect (no data) blocks */
-	
+
 	/* 1) Single indirect */
 	uint32_t fblock = ext4_inode_get_indirect_block(inode_ref->inode, 0);
@@ -1045,12 +1045,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_inode_set_indirect_block(inode_ref->inode, 0, 0);
 	}
-	
+
 	block_t *block;
 	uint32_t block_size = ext4_superblock_get_block_size(fs->superblock);
 	uint32_t count = block_size / sizeof(uint32_t);
-	
+
 	/* 2) Double indirect */
 	fblock = ext4_inode_get_indirect_block(inode_ref->inode, 1);
@@ -1059,9 +1059,9 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		uint32_t ind_block;
 		for (uint32_t offset = 0; offset < count; ++offset) {
 			ind_block = uint32_t_le2host(((uint32_t *) block->data)[offset]);
-			
+
 			if (ind_block != 0) {
 				rc = ext4_balloc_free_block(inode_ref, ind_block);
@@ -1072,5 +1072,5 @@
 			}
 		}
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
@@ -1080,8 +1080,8 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_inode_set_indirect_block(inode_ref->inode, 1, 0);
 	}
-	
+
 	/* 3) Tripple indirect */
 	block_t *subblock;
@@ -1091,9 +1091,9 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		uint32_t ind_block;
 		for (uint32_t offset = 0; offset < count; ++offset) {
 			ind_block = uint32_t_le2host(((uint32_t *) block->data)[offset]);
-			
+
 			if (ind_block != 0) {
 				rc = block_get(&subblock, fs->device, ind_block,
@@ -1103,5 +1103,5 @@
 					return rc;
 				}
-				
+
 				uint32_t ind_subblock;
 				for (uint32_t suboffset = 0; suboffset < count;
@@ -1109,5 +1109,5 @@
 					ind_subblock = uint32_t_le2host(((uint32_t *)
 					    subblock->data)[suboffset]);
-					
+
 					if (ind_subblock != 0) {
 						rc = ext4_balloc_free_block(inode_ref, ind_subblock);
@@ -1119,5 +1119,5 @@
 					}
 				}
-				
+
 				rc = block_put(subblock);
 				if (rc != EOK) {
@@ -1126,5 +1126,5 @@
 				}
 			}
-			
+
 			rc = ext4_balloc_free_block(inode_ref, ind_block);
 			if (rc != EOK) {
@@ -1133,5 +1133,5 @@
 			}
 		}
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
@@ -1141,12 +1141,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_inode_set_indirect_block(inode_ref->inode, 2, 0);
 	}
-	
+
 finish:
 	/* Mark inode dirty for writing to the physical device */
 	inode_ref->dirty = true;
-	
+
 	/* Free block with extended attributes if present */
 	uint32_t xattr_block = ext4_inode_get_file_acl(
@@ -1156,8 +1156,8 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_inode_set_file_acl(inode_ref->inode, fs->superblock, 0);
 	}
-	
+
 	/* Free inode by allocator */
 	errno_t rc;
@@ -1167,5 +1167,5 @@
 	else
 		rc = ext4_ialloc_free_inode(fs, inode_ref->index, false);
-	
+
 	return rc;
 }
@@ -1183,18 +1183,18 @@
 {
 	ext4_superblock_t *sb = inode_ref->fs->superblock;
-	
+
 	/* Check flags, if i-node can be truncated */
 	if (!ext4_inode_can_truncate(sb, inode_ref->inode))
 		return EINVAL;
-	
+
 	/* If sizes are equal, nothing has to be done. */
 	aoff64_t old_size = ext4_inode_get_size(sb, inode_ref->inode);
 	if (old_size == new_size)
 		return EOK;
-	
+
 	/* It's not suppported to make the larger file by truncate operation */
 	if (old_size < new_size)
 		return EINVAL;
-	
+
 	/* Compute how many blocks will be released */
 	aoff64_t size_diff = old_size - new_size;
@@ -1203,9 +1203,9 @@
 	if (size_diff % block_size != 0)
 		diff_blocks_count++;
-	
+
 	uint32_t old_blocks_count = old_size / block_size;
 	if (old_size % block_size != 0)
 		old_blocks_count++;
-	
+
 	if ((ext4_superblock_has_feature_incompatible(inode_ref->fs->superblock,
 	    EXT4_FEATURE_INCOMPAT_EXTENTS)) &&
@@ -1218,5 +1218,5 @@
 	} else {
 		/* Release data blocks from the end of file */
-		
+
 		/* Starting from 1 because of logical blocks are numbered from 0 */
 		for (uint32_t i = 1; i <= diff_blocks_count; ++i) {
@@ -1227,9 +1227,9 @@
 		}
 	}
-	
+
 	/* Update i-node */
 	ext4_inode_set_size(inode_ref->inode, new_size);
 	inode_ref->dirty = true;
-	
+
 	return EOK;
 }
@@ -1248,5 +1248,5 @@
 {
 	ext4_filesystem_t *fs = inode_ref->fs;
-	
+
 	/* For empty file is situation simple */
 	if (ext4_inode_get_size(fs->superblock, inode_ref->inode) == 0) {
@@ -1254,7 +1254,7 @@
 		return EOK;
 	}
-	
+
 	uint32_t current_block;
-	
+
 	/* Handle i-node using extents */
 	if ((ext4_superblock_has_feature_incompatible(fs->superblock,
@@ -1264,11 +1264,11 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		*fblock = current_block;
 		return EOK;
 	}
-	
+
 	ext4_inode_t *inode = inode_ref->inode;
-	
+
 	/* Direct block are read directly from array in i-node structure */
 	if (iblock < EXT4_INODE_DIRECT_BLOCK_COUNT) {
@@ -1277,5 +1277,5 @@
 		return EOK;
 	}
-	
+
 	/* Determine indirection level of the target block */
 	unsigned int level = 0;
@@ -1286,8 +1286,8 @@
 		}
 	}
-	
+
 	if (level == 0)
 		return EIO;
-	
+
 	/* Compute offsets for the topmost level */
 	aoff64_t block_offset_in_level =
@@ -1296,5 +1296,5 @@
 	uint32_t offset_in_block =
 	    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
-	
+
 	/* Sparse file */
 	if (current_block == 0) {
@@ -1302,7 +1302,7 @@
 		return EOK;
 	}
-	
+
 	block_t *block;
-	
+
 	/*
 	 * Navigate through other levels, until we find the block number
@@ -1314,14 +1314,14 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Read block address from indirect block */
 		current_block =
 		    uint32_t_le2host(((uint32_t *) block->data)[offset_in_block]);
-		
+
 		/* Put back indirect block untouched */
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Check for sparse file */
 		if (current_block == 0) {
@@ -1329,12 +1329,12 @@
 			return EOK;
 		}
-		
+
 		/* Jump to the next level */
 		level--;
-		
+
 		/* Termination condition - we have address of data block loaded */
 		if (level == 0)
 			break;
-		
+
 		/* Visit the next level */
 		block_offset_in_level %= fs->inode_blocks_per_level[level];
@@ -1342,7 +1342,7 @@
 		    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
 	}
-	
+
 	*fblock = current_block;
-	
+
 	return EOK;
 }
@@ -1361,5 +1361,5 @@
 {
 	ext4_filesystem_t *fs = inode_ref->fs;
-	
+
 	/* Handle inode using extents */
 	if ((ext4_superblock_has_feature_compatible(fs->superblock,
@@ -1369,13 +1369,13 @@
 		return ENOTSUP;
 	}
-	
+
 	/* Handle simple case when we are dealing with direct reference */
 	if (iblock < EXT4_INODE_DIRECT_BLOCK_COUNT) {
 		ext4_inode_set_direct_block(inode_ref->inode, (uint32_t) iblock, fblock);
 		inode_ref->dirty = true;
-		
+
 		return EOK;
 	}
-	
+
 	/* Determine the indirection level needed to get the desired block */
 	unsigned int level = 0;
@@ -1386,10 +1386,10 @@
 		}
 	}
-	
+
 	if (level == 0)
 		return EIO;
-	
+
 	uint32_t block_size = ext4_superblock_get_block_size(fs->superblock);
-	
+
 	/* Compute offsets for the topmost level */
 	aoff64_t block_offset_in_level =
@@ -1399,9 +1399,9 @@
 	uint32_t offset_in_block =
 	    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
-	
+
 	uint32_t new_block_addr;
 	block_t *block;
 	block_t *new_block;
-	
+
 	/* Is needed to allocate indirect block on the i-node level */
 	if (current_block == 0) {
@@ -1410,10 +1410,10 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		/* Update i-node */
 		ext4_inode_set_indirect_block(inode_ref->inode, level - 1,
 		    new_block_addr);
 		inode_ref->dirty = true;
-		
+
 		/* Load newly allocated block */
 		rc = block_get(&new_block, fs->device, new_block_addr,
@@ -1423,17 +1423,17 @@
 			return rc;
 		}
-		
+
 		/* Initialize new block */
 		memset(new_block->data, 0, block_size);
 		new_block->dirty = true;
-		
+
 		/* Put back the allocated block */
 		rc = block_put(new_block);
 		if (rc != EOK)
 			return rc;
-		
+
 		current_block = new_block_addr;
 	}
-	
+
 	/*
 	 * Navigate through other levels, until we find the block number
@@ -1444,8 +1444,8 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		current_block =
 		    uint32_t_le2host(((uint32_t *) block->data)[offset_in_block]);
-		
+
 		if ((level > 1) && (current_block == 0)) {
 			/* Allocate new block */
@@ -1455,5 +1455,5 @@
 				return rc;
 			}
-			
+
 			/* Load newly allocated block */
 			rc = block_get(&new_block, fs->device, new_block_addr,
@@ -1463,9 +1463,9 @@
 				return rc;
 			}
-			
+
 			/* Initialize allocated block */
 			memset(new_block->data, 0, block_size);
 			new_block->dirty = true;
-			
+
 			rc = block_put(new_block);
 			if (rc != EOK) {
@@ -1473,5 +1473,5 @@
 				return rc;
 			}
-			
+
 			/* Write block address to the parent */
 			((uint32_t *) block->data)[offset_in_block] =
@@ -1480,5 +1480,5 @@
 			current_block = new_block_addr;
 		}
-		
+
 		/* Will be finished, write the fblock address */
 		if (level == 1) {
@@ -1487,11 +1487,11 @@
 			block->dirty = true;
 		}
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
-		
+
 		level--;
-		
+
 		/*
 		 * If we are on the last level, break here as
@@ -1500,5 +1500,5 @@
 		if (level == 0)
 			break;
-		
+
 		/* Visit the next level */
 		block_offset_in_level %= fs->inode_blocks_per_level[level];
@@ -1506,5 +1506,5 @@
 		    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
 	}
-	
+
 	return EOK;
 }
@@ -1522,26 +1522,26 @@
 {
 	uint32_t fblock;
-	
+
 	ext4_filesystem_t *fs = inode_ref->fs;
-	
+
 	/* Extents are handled otherwise = there is not support in this function */
 	assert(!(ext4_superblock_has_feature_incompatible(fs->superblock,
 	    EXT4_FEATURE_INCOMPAT_EXTENTS) &&
 	    (ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_EXTENTS))));
-	
+
 	ext4_inode_t *inode = inode_ref->inode;
-	
+
 	/* Handle simple case when we are dealing with direct reference */
 	if (iblock < EXT4_INODE_DIRECT_BLOCK_COUNT) {
 		fblock = ext4_inode_get_direct_block(inode, iblock);
-		
+
 		/* Sparse file */
 		if (fblock == 0)
 			return EOK;
-		
+
 		ext4_inode_set_direct_block(inode, iblock, 0);
 		return ext4_balloc_free_block(inode_ref, fblock);
 	}
-	
+
 	/* Determine the indirection level needed to get the desired block */
 	unsigned int level = 0;
@@ -1552,8 +1552,8 @@
 		}
 	}
-	
+
 	if (level == 0)
 		return EIO;
-	
+
 	/* Compute offsets for the topmost level */
 	aoff64_t block_offset_in_level =
@@ -1563,5 +1563,5 @@
 	uint32_t offset_in_block =
 	    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
-	
+
 	/*
 	 * Navigate through other levels, until we find the block number
@@ -1570,16 +1570,16 @@
 	block_t *block;
 	while (level > 0) {
-		
+
 		/* Sparse check */
 		if (current_block == 0)
 			return EOK;
-		
+
 		errno_t rc = block_get(&block, fs->device, current_block, 0);
 		if (rc != EOK)
 			return rc;
-		
+
 		current_block =
 		    uint32_t_le2host(((uint32_t *) block->data)[offset_in_block]);
-		
+
 		/* Set zero if physical data block address found */
 		if (level == 1) {
@@ -1588,11 +1588,11 @@
 			block->dirty = true;
 		}
-		
+
 		rc = block_put(block);
 		if (rc != EOK)
 			return rc;
-		
+
 		level--;
-		
+
 		/*
 		 * If we are on the last level, break here as
@@ -1601,5 +1601,5 @@
 		if (level == 0)
 			break;
-		
+
 		/* Visit the next level */
 		block_offset_in_level %= fs->inode_blocks_per_level[level];
@@ -1607,9 +1607,9 @@
 		    block_offset_in_level / fs->inode_blocks_per_level[level - 1];
 	}
-	
+
 	fblock = current_block;
 	if (fblock == 0)
 		return EOK;
-	
+
 	/* Physical block is not referenced, it can be released */
 	return ext4_balloc_free_block(inode_ref, fblock);
@@ -1633,18 +1633,18 @@
 	    (ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_EXTENTS)))
 		return ext4_extent_append_block(inode_ref, iblock, fblock, true);
-	
+
 	ext4_superblock_t *sb = inode_ref->fs->superblock;
-	
+
 	/* Compute next block index and allocate data block */
 	uint64_t inode_size = ext4_inode_get_size(sb, inode_ref->inode);
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
-	
+
 	/* Align size i-node size */
 	if ((inode_size % block_size) != 0)
 		inode_size += block_size - (inode_size % block_size);
-	
+
 	/* Logical blocks are numbered from 0 */
 	uint32_t new_block_idx = inode_size / block_size;
-	
+
 	/* Allocate new physical block */
 	uint32_t phys_block;
@@ -1652,5 +1652,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Add physical block address to the i-node */
 	rc = ext4_filesystem_set_inode_data_block_index(inode_ref,
@@ -1660,12 +1660,12 @@
 		return rc;
 	}
-	
+
 	/* Update i-node */
 	ext4_inode_set_size(inode_ref->inode, inode_size + block_size);
 	inode_ref->dirty = true;
-	
+
 	*fblock = phys_block;
 	*iblock = new_block_idx;
-	
+
 	return EOK;
 }
Index: uspace/lib/ext4/src/ialloc.c
===================================================================
--- uspace/lib/ext4/src/ialloc.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/ialloc.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -100,13 +100,13 @@
 {
 	ext4_superblock_t *sb = fs->superblock;
-	
+
 	/* Compute index of block group and load it */
 	uint32_t block_group = ext4_ialloc_get_bgid_of_inode(sb, index);
-	
+
 	ext4_block_group_ref_t *bg_ref;
 	errno_t rc = ext4_filesystem_get_block_group_ref(fs, block_group, &bg_ref);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Load i-node bitmap */
 	uint32_t bitmap_block_addr = ext4_block_group_get_inode_bitmap(
@@ -117,10 +117,10 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Free i-node in the bitmap */
 	uint32_t index_in_group = ext4_ialloc_inode2index_in_group(sb, index);
 	ext4_bitmap_free_bit(bitmap_block->data, index_in_group);
 	bitmap_block->dirty = true;
-	
+
 	/* Put back the block with bitmap */
 	rc = block_put(bitmap_block);
@@ -130,5 +130,5 @@
 		return rc;
 	}
-	
+
 	/* If released i-node is a directory, decrement used directories count */
 	if (is_dir) {
@@ -139,5 +139,5 @@
 		    bg_used_dirs);
 	}
-	
+
 	/* Update block group free inodes count */
 	uint32_t free_inodes = ext4_block_group_get_free_inodes_count(
@@ -146,12 +146,12 @@
 	ext4_block_group_set_free_inodes_count(bg_ref->block_group, sb,
 	    free_inodes);
-	
+
 	bg_ref->dirty = true;
-	
+
 	/* Put back the modified block group */
 	rc = ext4_filesystem_put_block_group_ref(bg_ref);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Update superblock free inodes count */
 	uint32_t sb_free_inodes =
@@ -159,5 +159,5 @@
 	sb_free_inodes++;
 	ext4_superblock_set_free_inodes_count(sb, sb_free_inodes);
-	
+
 	return EOK;
 }
@@ -178,10 +178,10 @@
 {
 	ext4_superblock_t *sb = fs->superblock;
-	
+
 	uint32_t bgid = 0;
 	uint32_t bg_count = ext4_superblock_get_block_group_count(sb);
 	uint32_t sb_free_inodes = ext4_superblock_get_free_inodes_count(sb);
 	uint32_t avg_free_inodes = sb_free_inodes / bg_count;
-	
+
 	/* Try to find free i-node in all block groups */
 	while (bgid < bg_count) {
@@ -191,12 +191,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		ext4_block_group_t *bg = bg_ref->block_group;
-		
+
 		/* Read necessary values for algorithm */
 		uint32_t free_blocks = ext4_block_group_get_free_blocks_count(bg, sb);
 		uint32_t free_inodes = ext4_block_group_get_free_inodes_count(bg, sb);
 		uint32_t used_dirs = ext4_block_group_get_used_dirs_count(bg, sb);
-		
+
 		/*
 		 * Check if this block group is a good candidate
@@ -216,5 +216,5 @@
 			uint32_t bitmap_block_addr = ext4_block_group_get_inode_bitmap(
 			    bg_ref->block_group, sb);
-			
+
 			block_t *bitmap_block;
 			rc = block_get(&bitmap_block, fs->device, bitmap_block_addr,
@@ -224,5 +224,5 @@
 				return rc;
 			}
-			
+
 			/* Try to allocate i-node in the bitmap */
 			uint32_t inodes_in_group = ext4_superblock_get_inodes_in_group(sb, bgid);
@@ -230,5 +230,5 @@
 			rc = ext4_bitmap_find_free_bit_and_set(bitmap_block->data,
 			    0, &index_in_group, inodes_in_group);
-			
+
 			/* Block group has not any free i-node */
 			if (rc == ENOSPC) {
@@ -246,8 +246,8 @@
 				continue;
 			}
-			
+
 			/* Free i-node found, save the bitmap */
 			bitmap_block->dirty = true;
-			
+
 			rc = block_put(bitmap_block);
 			if (rc != EOK) {
@@ -255,9 +255,9 @@
 				return rc;
 			}
-			
+
 			/* Modify filesystem counters */
 			free_inodes--;
 			ext4_block_group_set_free_inodes_count(bg, sb, free_inodes);
-			
+
 			/* Increment used directories counter */
 			if (is_dir) {
@@ -265,5 +265,5 @@
 				ext4_block_group_set_used_dirs_count(bg, sb, used_dirs);
 			}
-			
+
 			/* Decrease unused inodes count */
 			if (ext4_block_group_has_flag(bg,
@@ -271,10 +271,10 @@
 				uint32_t unused =
 				    ext4_block_group_get_itable_unused(bg, sb);
-				
+
 				uint32_t inodes_in_group =
 				    ext4_superblock_get_inodes_in_group(sb, bgid);
-				
+
 				uint32_t free = inodes_in_group - unused;
-				
+
 				if (index_in_group >= free) {
 					unused = inodes_in_group - (index_in_group + 1);
@@ -282,22 +282,22 @@
 				}
 			}
-			
+
 			/* Save modified block group */
 			bg_ref->dirty = true;
-			
+
 			rc = ext4_filesystem_put_block_group_ref(bg_ref);
 			if (rc != EOK)
 				return rc;
-			
+
 			/* Update superblock */
 			sb_free_inodes--;
 			ext4_superblock_set_free_inodes_count(sb, sb_free_inodes);
-			
+
 			/* Compute the absolute i-nodex number */
 			*index = ext4_ialloc_index_in_group2inode(sb, index_in_group, bgid);
-			
+
 			return EOK;
 		}
-		
+
 		/* Block group not modified, put it and jump to the next block group */
 		rc = ext4_filesystem_put_block_group_ref(bg_ref);
@@ -307,5 +307,5 @@
 		++bgid;
 	}
-	
+
 	return ENOSPC;
 }
Index: uspace/lib/ext4/src/inode.c
===================================================================
--- uspace/lib/ext4/src/inode.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/inode.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -53,10 +53,10 @@
 	uint32_t bits = 8;
 	uint32_t size = block_size;
-	
+
 	do {
 		bits++;
 		size = size >> 1;
 	} while (size > 256);
-	
+
 	return bits;
 }
@@ -76,5 +76,5 @@
 		    ((uint32_t) uint16_t_le2host(inode->mode));
 	}
-	
+
 	return uint16_t_le2host(inode->mode);
 }
@@ -90,5 +90,5 @@
 {
 	inode->mode = host2uint16_t_le((mode << 16) >> 16);
-	
+
 	if (ext4_superblock_get_creator_os(sb) == EXT4_SUPERBLOCK_OS_HURD)
 		inode->osd2.hurd2.mode_high = host2uint16_t_le(mode >> 16);
@@ -129,10 +129,10 @@
 {
 	uint32_t major_rev = ext4_superblock_get_rev_level(sb);
-	
+
 	if ((major_rev > 0) &&
 	    (ext4_inode_is_type(sb, inode, EXT4_INODE_MODE_FILE)))
 		return ((uint64_t)uint32_t_le2host(inode->size_hi)) << 32 |
 		    ((uint64_t)uint32_t_le2host(inode->size_lo));
-	
+
 	return uint32_t_le2host(inode->size_lo);
 }
@@ -304,5 +304,5 @@
 		    uint16_t_le2host(inode->osd2.linux2.blocks_high)) << 32 |
 		    uint32_t_le2host(inode->blocks_count_lo);
-		
+
 		if (ext4_inode_has_flag(inode, EXT4_INODE_FLAG_HUGE_FILE)) {
 			uint32_t block_size = ext4_superblock_get_block_size(sb);
@@ -330,22 +330,22 @@
 	uint64_t max = 0;
 	max = ~max >> 32;
-	
+
 	if (count <= max) {
 		inode->blocks_count_lo = host2uint32_t_le(count);
 		inode->osd2.linux2.blocks_high = 0;
 		ext4_inode_clear_flag(inode, EXT4_INODE_FLAG_HUGE_FILE);
-		
+
 		return EOK;
 	}
-	
+
 	/* Check if there can be used huge files (many blocks) */
 	if (!ext4_superblock_has_feature_read_only(sb,
 	    EXT4_FEATURE_RO_COMPAT_HUGE_FILE))
 		return EINVAL;
-	
+
 	/* 48-bit maximum */
 	max = 0;
 	max = ~max >> 16;
-	
+
 	if (count <= max) {
 		inode->blocks_count_lo = host2uint32_t_le(count);
@@ -360,5 +360,5 @@
 		inode->osd2.linux2.blocks_high = host2uint16_t_le(count >> 32);
 	}
-	
+
 	return EOK;
 }
@@ -424,5 +424,5 @@
 		    uint16_t_le2host(inode->osd2.linux2.file_acl_high)) << 16 |
 		    (uint32_t_le2host(inode->file_acl_lo));
-	
+
 	return uint32_t_le2host(inode->file_acl_lo);
 }
@@ -439,5 +439,5 @@
 {
 	inode->file_acl_lo = host2uint32_t_le((file_acl << 32) >> 32);
-	
+
 	if (ext4_superblock_get_creator_os(sb) == EXT4_SUPERBLOCK_OS_LINUX)
 		inode->osd2.linux2.file_acl_high = host2uint16_t_le(file_acl >> 32);
@@ -455,5 +455,5 @@
 {
 	assert(idx < EXT4_INODE_DIRECT_BLOCK_COUNT);
-	
+
 	return uint32_t_le2host(inode->blocks[idx]);
 }
@@ -469,5 +469,5 @@
 {
 	assert(idx < EXT4_INODE_DIRECT_BLOCK_COUNT);
-	
+
 	inode->blocks[idx] = host2uint32_t_le(fblock);
 }
@@ -540,5 +540,5 @@
 	if (ext4_inode_get_flags(inode) & flag)
 		return true;
-	
+
 	return false;
 }
@@ -583,9 +583,9 @@
 	    (ext4_inode_has_flag(inode, EXT4_INODE_FLAG_IMMUTABLE)))
 		return false;
-	
+
 	if ((ext4_inode_is_type(sb, inode, EXT4_INODE_MODE_FILE)) ||
 	    (ext4_inode_is_type(sb, inode, EXT4_INODE_MODE_DIRECTORY)))
 		return true;
-	
+
 	return false;
 }
Index: uspace/lib/ext4/src/ops.c
===================================================================
--- uspace/lib/ext4/src/ops.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/ops.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -117,5 +117,5 @@
 	node_key_t *key = (node_key_t *)key_arg;
 	ext4_node_t *enode = hash_table_get_inst(item, ext4_node_t, link);
-	
+
 	return key->service_id == enode->instance->service_id
 		&& key->index == enode->inode_ref->index;
@@ -142,5 +142,5 @@
 	if (!hash_table_create(&open_nodes, 0, 0, &open_nodes_ops))
 		return ENOMEM;
-	
+
 	return EOK;
 }
@@ -173,10 +173,10 @@
 {
 	fibril_mutex_lock(&instance_list_mutex);
-	
+
 	if (list_empty(&instance_list)) {
 		fibril_mutex_unlock(&instance_list_mutex);
 		return EINVAL;
 	}
-	
+
 	list_foreach(instance_list, link, ext4_instance_t, tmp) {
 		if (tmp->service_id == service_id) {
@@ -186,5 +186,5 @@
 		}
 	}
-	
+
 	fibril_mutex_unlock(&instance_list_mutex);
 	return EINVAL;
@@ -219,9 +219,9 @@
 	ext4_node_t *eparent = EXT4_NODE(pfn);
 	ext4_filesystem_t *fs = eparent->instance->filesystem;
-	
+
 	if (!ext4_inode_is_type(fs->superblock, eparent->inode_ref->inode,
 	    EXT4_INODE_MODE_DIRECTORY))
 		return ENOTDIR;
-	
+
 	/* Try to find entry */
 	ext4_directory_search_result_t result;
@@ -233,8 +233,8 @@
 			return EOK;
 		}
-		
-		return rc;
-	}
-	
+
+		return rc;
+	}
+
 	/* Load node from search result */
 	uint32_t inode = ext4_directory_entry_ll_get_inode(result.dentry);
@@ -268,5 +268,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	return ext4_node_get_core(rfn, inst, index);
 }
@@ -285,5 +285,5 @@
 {
 	fibril_mutex_lock(&open_nodes_lock);
-	
+
 	/* Check if the node is not already open */
 	node_key_t key = {
@@ -291,5 +291,5 @@
 		.index = index
 	};
-	
+
 	ht_link_t *already_open = hash_table_find(&open_nodes, &key);
 	ext4_node_t *enode = NULL;
@@ -298,9 +298,9 @@
 		*rfn = enode->fs_node;
 		enode->references++;
-		
+
 		fibril_mutex_unlock(&open_nodes_lock);
 		return EOK;
 	}
-	
+
 	/* Prepare new enode */
 	enode = malloc(sizeof(ext4_node_t));
@@ -309,5 +309,5 @@
 		return ENOMEM;
 	}
-	
+
 	/* Prepare new fs_node and initialize */
 	fs_node_t *fs_node = malloc(sizeof(fs_node_t));
@@ -317,7 +317,7 @@
 		return ENOMEM;
 	}
-	
+
 	fs_node_initialize(fs_node);
-	
+
 	/* Load i-node from filesystem */
 	ext4_inode_ref_t *inode_ref;
@@ -330,5 +330,5 @@
 		return rc;
 	}
-	
+
 	/* Initialize enode */
 	enode->inode_ref = inode_ref;
@@ -336,13 +336,13 @@
 	enode->references = 1;
 	enode->fs_node = fs_node;
-	
+
 	fs_node->data = enode;
 	*rfn = fs_node;
-	
+
 	hash_table_insert(&open_nodes, &enode->link);
 	inst->open_nodes_count++;
-	
+
 	fibril_mutex_unlock(&open_nodes_lock);
-	
+
 	return EOK;
 }
@@ -360,14 +360,14 @@
 	assert(enode->instance->open_nodes_count > 0);
 	enode->instance->open_nodes_count--;
-	
+
 	/* Put inode back in filesystem */
 	errno_t rc = ext4_filesystem_put_inode_ref(enode->inode_ref);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Destroy data structure */
 	free(enode->fs_node);
 	free(enode);
-	
+
 	return EOK;
 }
@@ -399,5 +399,5 @@
 {
 	fibril_mutex_lock(&open_nodes_lock);
-	
+
 	ext4_node_t *enode = EXT4_NODE(fn);
 	assert(enode->references > 0);
@@ -410,7 +410,7 @@
 		}
 	}
-	
+
 	fibril_mutex_unlock(&open_nodes_lock);
-	
+
 	return EOK;
 }
@@ -432,5 +432,5 @@
 	if (enode == NULL)
 		return ENOMEM;
-	
+
 	/* Allocate fs_node */
 	fs_node_t *fs_node;
@@ -440,5 +440,5 @@
 		return ENOMEM;
 	}
-	
+
 	/* Load instance */
 	ext4_instance_t *inst;
@@ -449,5 +449,5 @@
 		return rc;
 	}
-	
+
 	/* Allocate new i-node in filesystem */
 	ext4_inode_ref_t *inode_ref;
@@ -458,22 +458,22 @@
 		return rc;
 	}
-	
+
 	/* Do some interconnections in references */
 	enode->inode_ref = inode_ref;
 	enode->instance = inst;
 	enode->references = 1;
-	
+
 	fibril_mutex_lock(&open_nodes_lock);
 	hash_table_insert(&open_nodes, &enode->link);
 	fibril_mutex_unlock(&open_nodes_lock);
 	inst->open_nodes_count++;
-	
+
 	enode->inode_ref->dirty = true;
-	
+
 	fs_node_initialize(fs_node);
 	fs_node->data = enode;
 	enode->fs_node = fs_node;
 	*rfn = fs_node;
-	
+
 	return EOK;
 }
@@ -495,13 +495,13 @@
 		return rc;
 	}
-	
+
 	if (has_children) {
 		ext4_node_put(fn);
 		return EINVAL;
 	}
-	
+
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_inode_ref_t *inode_ref = enode->inode_ref;
-	
+
 	/* Release data blocks */
 	rc = ext4_filesystem_truncate_inode(inode_ref, 0);
@@ -510,5 +510,5 @@
 		return rc;
 	}
-	
+
 	/*
 	 * TODO: Sset real deletion time when it will be supported.
@@ -517,5 +517,5 @@
 	ext4_inode_set_deletion_time(inode_ref->inode, 0xdeadbeef);
 	inode_ref->dirty = true;
-	
+
 	/* Free inode */
 	rc = ext4_filesystem_free_inode(inode_ref);
@@ -524,5 +524,5 @@
 		return rc;
 	}
-	
+
 	return ext4_node_put(fn);
 }
@@ -542,9 +542,9 @@
 	if (str_size(name) > EXT4_DIRECTORY_FILENAME_LEN)
 		return ENAMETOOLONG;
-	
+
 	ext4_node_t *parent = EXT4_NODE(pfn);
 	ext4_node_t *child = EXT4_NODE(cfn);
 	ext4_filesystem_t *fs = parent->instance->filesystem;
-	
+
 	/* Add entry to parent directory */
 	errno_t rc = ext4_directory_add_entry(parent->inode_ref, name,
@@ -552,5 +552,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Fill new dir -> add '.' and '..' entries */
 	if (ext4_inode_is_type(fs->superblock, child->inode_ref->inode,
@@ -562,5 +562,5 @@
 			return rc;
 		}
-		
+
 		rc = ext4_directory_add_entry(child->inode_ref, "..",
 		    parent->inode_ref);
@@ -570,5 +570,5 @@
 			return rc;
 		}
-		
+
 		/* Initialize directory index if supported */
 		if (ext4_superblock_has_feature_compatible(fs->superblock,
@@ -577,25 +577,25 @@
 			if (rc != EOK)
 				return rc;
-			
+
 			ext4_inode_set_flag(child->inode_ref->inode,
 			    EXT4_INODE_FLAG_INDEX);
 			child->inode_ref->dirty = true;
 		}
-	
+
 		uint16_t parent_links =
 		    ext4_inode_get_links_count(parent->inode_ref->inode);
 		parent_links++;
 		ext4_inode_set_links_count(parent->inode_ref->inode, parent_links);
-		
+
 		parent->inode_ref->dirty = true;
 	}
-	
+
 	uint16_t child_links =
 	    ext4_inode_get_links_count(child->inode_ref->inode);
 	child_links++;
 	ext4_inode_set_links_count(child->inode_ref->inode, child_links);
-	
+
 	child->inode_ref->dirty = true;
-	
+
 	return EOK;
 }
@@ -616,9 +616,9 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Cannot unlink non-empty node */
 	if (has_children)
 		return ENOTEMPTY;
-	
+
 	/* Remove entry from parent directory */
 	ext4_inode_ref_t *parent = EXT4_NODE(pfn)->inode_ref;
@@ -626,26 +626,26 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Decrement links count */
 	ext4_inode_ref_t *child_inode_ref = EXT4_NODE(cfn)->inode_ref;
-	
+
 	uint32_t lnk_count =
 	    ext4_inode_get_links_count(child_inode_ref->inode);
 	lnk_count--;
-	
+
 	/* If directory - handle links from parent */
 	if ((lnk_count <= 1) && (ext4_is_directory(cfn))) {
 		assert(lnk_count == 1);
-		
+
 		lnk_count--;
-		
+
 		ext4_inode_ref_t *parent_inode_ref = EXT4_NODE(pfn)->inode_ref;
-		
+
 		uint32_t parent_lnk_count = ext4_inode_get_links_count(
 		    parent_inode_ref->inode);
-		
+
 		parent_lnk_count--;
 		ext4_inode_set_links_count(parent_inode_ref->inode, parent_lnk_count);
-		
+
 		parent->dirty = true;
 	}
@@ -659,5 +659,5 @@
 	 * parent->dirty = true;
 	 */
-	
+
 	/*
 	 * TODO: Update timestamp for inode.
@@ -666,8 +666,8 @@
 	 *     (uint32_t) now);
 	 */
-	
+
 	ext4_inode_set_links_count(child_inode_ref->inode, lnk_count);
 	child_inode_ref->dirty = true;
-	
+
 	return EOK;
 }
@@ -687,5 +687,5 @@
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_filesystem_t *fs = enode->instance->filesystem;
-	
+
 	/* Check if node is directory */
 	if (!ext4_inode_is_type(fs->superblock, enode->inode_ref->inode,
@@ -694,10 +694,10 @@
 		return EOK;
 	}
-	
+
 	ext4_directory_iterator_t it;
 	errno_t rc = ext4_directory_iterator_init(&it, enode->inode_ref, 0);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Find a non-empty directory entry */
 	bool found = false;
@@ -712,5 +712,5 @@
 			}
 		}
-		
+
 		rc = ext4_directory_iterator_next(&it);
 		if (rc != EOK) {
@@ -719,11 +719,11 @@
 		}
 	}
-	
+
 	rc = ext4_directory_iterator_fini(&it);
 	if (rc != EOK)
 		return rc;
-	
+
 	*has_children = found;
-	
+
 	return EOK;
 }
@@ -767,5 +767,5 @@
 	ext4_node_t *enode = EXT4_NODE(fn);
 	uint32_t lnkcnt = ext4_inode_get_links_count(enode->inode_ref->inode);
-	
+
 	if (ext4_is_directory(fn)) {
 		if (lnkcnt > 1)
@@ -774,5 +774,5 @@
 			return 0;
 	}
-	
+
 	/* For regular files return real links count */
 	return lnkcnt;
@@ -790,5 +790,5 @@
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_superblock_t *sb = enode->instance->filesystem->superblock;
-	
+
 	return ext4_inode_is_type(sb, enode->inode_ref->inode,
 	    EXT4_INODE_MODE_DIRECTORY);
@@ -806,5 +806,5 @@
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_superblock_t *sb = enode->instance->filesystem->superblock;
-	
+
 	return ext4_inode_is_type(sb, enode->inode_ref->inode,
 	    EXT4_INODE_MODE_FILE);
@@ -928,5 +928,5 @@
 {
 	ext4_filesystem_t *fs;
-	
+
 	/* Allocate instance structure */
 	ext4_instance_t *inst = (ext4_instance_t *)
@@ -934,5 +934,5 @@
 	if (inst == NULL)
 		return ENOMEM;
-	
+
 	enum cache_mode cmode;
 	if (str_cmp(opts, "wtcache") == 0)
@@ -940,10 +940,10 @@
 	else
 		cmode = CACHE_MODE_WB;
-	
+
 	/* Initialize instance */
 	link_initialize(&inst->link);
 	inst->service_id = service_id;
 	inst->open_nodes_count = 0;
-	
+
 	/* Initialize the filesystem */
 	aoff64_t rnsize;
@@ -953,13 +953,13 @@
 		return rc;
 	}
-	
+
 	/* Add instance to the list */
 	fibril_mutex_lock(&instance_list_mutex);
 	list_append(&inst->link, &instance_list);
 	fibril_mutex_unlock(&instance_list_mutex);
-	
+
 	*index = EXT4_INODE_ROOT_INDEX;
 	*size = rnsize;
-	
+
 	return EOK;
 }
@@ -980,19 +980,19 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	fibril_mutex_lock(&open_nodes_lock);
-	
+
 	if (inst->open_nodes_count != 0) {
 		fibril_mutex_unlock(&open_nodes_lock);
 		return EBUSY;
 	}
-	
+
 	/* Remove the instance from the list */
 	fibril_mutex_lock(&instance_list_mutex);
 	list_remove(&inst->link);
 	fibril_mutex_unlock(&instance_list_mutex);
-	
+
 	fibril_mutex_unlock(&open_nodes_lock);
-	
+
 	rc = ext4_filesystem_close(inst->filesystem);
 	if (rc != EOK) {
@@ -1028,5 +1028,5 @@
 		return EINVAL;
 	}
-	
+
 	ext4_instance_t *inst;
 	errno_t rc = ext4_instance_get(service_id, &inst);
@@ -1035,5 +1035,5 @@
 		return rc;
 	}
-	
+
 	/* Load i-node */
 	ext4_inode_ref_t *inode_ref;
@@ -1043,5 +1043,5 @@
 		return rc;
 	}
-	
+
 	/* Read from i-node by type */
 	if (ext4_inode_is_type(inst->filesystem->superblock, inode_ref->inode,
@@ -1058,7 +1058,7 @@
 		rc = ENOTSUP;
 	}
-	
+
 	errno_t const rc2 = ext4_filesystem_put_inode_ref(inode_ref);
-	
+
 	return rc == EOK ? rc2 : rc;
 }
@@ -1076,8 +1076,8 @@
 	if ((name_size == 1) && (name[0] == '.'))
 		return true;
-	
+
 	if ((name_size == 2) && (name[0] == '.') && (name[1] == '.'))
 		return true;
-	
+
 	return false;
 }
@@ -1104,5 +1104,5 @@
 		return rc;
 	}
-	
+
 	/*
 	 * Find next interesting directory entry.
@@ -1114,12 +1114,12 @@
 		if (it.current->inode == 0)
 			goto skip;
-		
+
 		uint16_t name_size = ext4_directory_entry_ll_get_name_length(
 		    inst->filesystem->superblock, it.current);
-		
+
 		/* Skip . and .. */
 		if (ext4_is_dots(it.current->name, name_size))
 			goto skip;
-		
+
 		/*
 		 * The on-disk entry does not contain \0 at the end
@@ -1133,13 +1133,13 @@
 			return ENOMEM;
 		}
-		
+
 		memcpy(buf, &it.current->name, name_size);
 		*(buf + name_size) = 0;
 		found = true;
-		
+
 		(void) async_data_read_finalize(callid, buf, name_size + 1);
 		free(buf);
 		break;
-		
+
 skip:
 		rc = ext4_directory_iterator_next(&it);
@@ -1150,5 +1150,5 @@
 		}
 	}
-	
+
 	uint64_t next;
 	if (found) {
@@ -1156,12 +1156,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
 		next = it.current_offset;
 	}
-	
+
 	rc = ext4_directory_iterator_fini(&it);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Prepare return values */
 	if (found) {
@@ -1191,5 +1191,5 @@
 	ext4_superblock_t *sb = inst->filesystem->superblock;
 	uint64_t file_size = ext4_inode_get_size(sb, inode_ref->inode);
-	
+
 	if (pos >= file_size) {
 		/* Read 0 bytes successfully */
@@ -1198,5 +1198,5 @@
 		return EOK;
 	}
-	
+
 	/* For now, we only read data from one block at a time */
 	uint32_t block_size = ext4_superblock_get_block_size(sb);
@@ -1204,9 +1204,9 @@
 	uint32_t offset_in_block = pos % block_size;
 	uint32_t bytes = min(block_size - offset_in_block, size);
-	
+
 	/* Handle end of file */
 	if (pos + bytes > file_size)
 		bytes = file_size - pos;
-	
+
 	/* Get the real block number */
 	uint32_t fs_block;
@@ -1217,5 +1217,5 @@
 		return rc;
 	}
-	
+
 	/*
 	 * Check for sparse file.
@@ -1231,14 +1231,14 @@
 			return ENOMEM;
 		}
-		
+
 		memset(buffer, 0, bytes);
-		
+
 		rc = async_data_read_finalize(callid, buffer, bytes);
 		*rbytes = bytes;
-		
+
 		free(buffer);
 		return rc;
 	}
-	
+
 	/* Usual case - we need to read a block from device */
 	block_t *block;
@@ -1248,5 +1248,5 @@
 		return rc;
 	}
-	
+
 	assert(offset_in_block + bytes <= block_size);
 	rc = async_data_read_finalize(callid, block->data + offset_in_block, bytes);
@@ -1255,9 +1255,9 @@
 		return rc;
 	}
-	
+
 	rc = block_put(block);
 	if (rc != EOK)
 		return rc;
-	
+
 	*rbytes = bytes;
 	return EOK;
@@ -1282,5 +1282,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	ipc_callid_t callid;
 	size_t len;
@@ -1290,20 +1290,20 @@
 		goto exit;
 	}
-	
+
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_filesystem_t *fs = enode->instance->filesystem;
-	
+
 	uint32_t block_size = ext4_superblock_get_block_size(fs->superblock);
-	
+
 	/* Prevent writing to more than one block */
 	uint32_t bytes = min(len, block_size - (pos % block_size));
-	
+
 	int flags = BLOCK_FLAGS_NONE;
 	if (bytes == block_size)
 		flags = BLOCK_FLAGS_NOREAD;
-	
+
 	uint32_t iblock =  pos / block_size;
 	uint32_t fblock;
-	
+
 	/* Load inode */
 	ext4_inode_ref_t *inode_ref = enode->inode_ref;
@@ -1314,5 +1314,5 @@
 		goto exit;
 	}
-	
+
 	/* Check for sparse file */
 	if (fblock == 0) {
@@ -1323,5 +1323,5 @@
 			    ext4_inode_get_size(fs->superblock, inode_ref->inode) /
 			    block_size;
-			
+
 			while (last_iblock < iblock) {
 				rc = ext4_extent_append_block(inode_ref, &last_iblock,
@@ -1332,5 +1332,5 @@
 				}
 			}
-			
+
 			rc = ext4_extent_append_block(inode_ref, &last_iblock,
 			    &fblock, false);
@@ -1345,5 +1345,5 @@
 				goto exit;
 			}
-			
+
 			rc = ext4_filesystem_set_inode_data_block_index(inode_ref,
 			    iblock, fblock);
@@ -1354,9 +1354,9 @@
 			}
 		}
-		
+
 		flags = BLOCK_FLAGS_NOREAD;
 		inode_ref->dirty = true;
 	}
-	
+
 	/* Load target block */
 	block_t *write_block;
@@ -1366,5 +1366,5 @@
 		goto exit;
 	}
-	
+
 	if (flags == BLOCK_FLAGS_NOREAD)
 		memset(write_block->data, 0, block_size);
@@ -1419,11 +1419,11 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	ext4_node_t *enode = EXT4_NODE(fn);
 	ext4_inode_ref_t *inode_ref = enode->inode_ref;
-	
+
 	rc = ext4_filesystem_truncate_inode(inode_ref, new_size);
 	errno_t const rc2 = ext4_node_put(fn);
-	
+
 	return rc == EOK ? rc2 : rc;
 }
@@ -1456,5 +1456,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Destroy the inode */
 	return ext4_destroy_node(fn);
@@ -1473,8 +1473,8 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	ext4_node_t *enode = EXT4_NODE(fn);
 	enode->inode_ref->dirty = true;
-	
+
 	return ext4_node_put(fn);
 }
Index: uspace/lib/ext4/src/superblock.c
===================================================================
--- uspace/lib/ext4/src/superblock.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/lib/ext4/src/superblock.c	(revision 55f068c2718ae33543fa18f49d0534ec95459b8d)
@@ -241,5 +241,5 @@
 	uint32_t log = 0;
 	uint32_t tmp = size / EXT4_MIN_BLOCK_SIZE;
-	
+
 	tmp >>= 1;
 	while (tmp) {
@@ -247,5 +247,5 @@
 		tmp >>= 1;
 	}
-	
+
 	ext4_superblock_set_log_block_size(sb, log);
 }
@@ -297,5 +297,5 @@
 	uint32_t log = 0;
 	uint32_t tmp = size / EXT4_MIN_BLOCK_SIZE;
-	
+
 	tmp >>= 1;
 	while (tmp) {
@@ -303,5 +303,5 @@
 		tmp >>= 1;
 	}
-	
+
 	ext4_superblock_set_log_frag_size(sb, log);
 }
@@ -736,5 +736,5 @@
 	if (ext4_superblock_get_rev_level(sb) == 0)
 		return EXT4_REV0_INODE_SIZE;
-	
+
 	return uint16_t_le2host(sb->inode_size);
 }
@@ -1001,8 +1001,8 @@
 {
 	uint16_t size = uint16_t_le2host(sb->desc_size);
-	
+
 	if (size < EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE)
 		size = EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE;
-	
+
 	return size;
 }
@@ -1021,5 +1021,5 @@
 		sb->desc_size =
 		    host2uint16_t_le(EXT4_MIN_BLOCK_GROUP_DESCRIPTOR_SIZE);
-	
+
 	sb->desc_size = host2uint16_t_le(size);
 }
@@ -1064,5 +1064,5 @@
 	if (ext4_superblock_get_flags(sb) & flag)
 		return true;
-	
+
 	return false;
 }
@@ -1081,5 +1081,5 @@
 	if (ext4_superblock_get_features_compatible(sb) & feature)
 		return true;
-	
+
 	return false;
 }
@@ -1098,5 +1098,5 @@
 	if (ext4_superblock_get_features_incompatible(sb) & feature)
 		return true;
-	
+
 	return false;
 }
@@ -1115,5 +1115,5 @@
 	if (ext4_superblock_get_features_read_only(sb) & feature)
 		return true;
-	
+
 	return false;
 }
@@ -1133,17 +1133,17 @@
 	if (data == NULL)
 		return ENOMEM;
-	
+
 	/* Read data from block device */
 	errno_t 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;
 }
@@ -1164,15 +1164,15 @@
 	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)
 		block_count++;
-	
+
 	/* Write data */
 	return block_write_direct(service_id, first_block, block_count, sb);
@@ -1203,31 +1203,31 @@
 	if (ext4_superblock_get_magic(sb) != EXT4_SUPERBLOCK_MAGIC)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_inodes_count(sb) == 0)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_blocks_count(sb) == 0)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_blocks_per_group(sb) == 0)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_inodes_per_group(sb) == 0)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_inode_size(sb) < 128)
 		return ENOTSUP;
-	
+
 	if (ext4_superblock_get_first_inode(sb) < 11)
 		return ENOTSUP;
-	
+
 	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)
 		return ENOTSUP;
-	
+
 	return EOK;
 }
@@ -1244,10 +1244,10 @@
 	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)
 		block_groups_count++;
-	
+
 	return block_groups_count;
 }
@@ -1269,5 +1269,5 @@
 	uint64_t total_blocks =
 	    ext4_superblock_get_blocks_count(sb);
-	
+
 	if (bgid < block_group_count - 1)
 		return blocks_per_group;
@@ -1292,5 +1292,5 @@
 	uint32_t total_inodes =
 	    ext4_superblock_get_inodes_count(sb);
-	
+
 	if (bgid < block_group_count - 1)
 		return inodes_per_group;
