Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 4f9ab1e931ca73f16a2e46e300122113719d1c1f)
+++ uspace/srv/vfs/vfs_ops.c	(revision 61600e74e6f0099b975c6be90e44560123057dc5)
@@ -67,16 +67,13 @@
 	size_t res = 0;
 	
-	while (a[res] == b[res] && a[res] != 0) {
+	while (a[res] == b[res] && a[res] != 0)
 		res++;
-	}
-	
-	if (a[res] == b[res]) {
+	
+	if (a[res] == b[res])
 		return res;
-	}
 	
 	res--;
-	while (a[res] != '/') {
+	while (a[res] != '/')
 		res--;
-	}
 	return res;
 }
@@ -86,6 +83,6 @@
 {
 	async_exch_t *exch = vfs_exchange_grab(file->fs_handle);
-	async_msg_2(exch, VFS_OUT_DESTROY,
-		(sysarg_t) file->service_id, (sysarg_t) file->index);
+	async_msg_2(exch, VFS_OUT_DESTROY, (sysarg_t) file->service_id,
+	    (sysarg_t) file->index);
 	vfs_exchange_release(exch);
 }
@@ -95,7 +92,7 @@
 	/* Lookup the file structure corresponding to fd. */
 	vfs_file_t *oldfile = vfs_file_get(oldfd);
-	if (oldfile == NULL) {
-		return EBADF;
-	}
+	if (oldfile == NULL)
+		return EBADF;
+
 	assert(oldfile->node != NULL);
 	
@@ -122,13 +119,11 @@
 {
 	/* If the file descriptors are the same, do nothing. */
-	if (oldfd == newfd) {
+	if (oldfd == newfd)
 		return EOK;
-	}
 	
 	/* Lookup the file structure corresponding to oldfd. */
 	vfs_file_t *oldfile = vfs_file_get(oldfd);
-	if (!oldfile) {
-		return EBADF;
-	}
+	if (!oldfile)
+		return EBADF;
 	
 	/* Make sure newfd is closed. */
@@ -145,7 +140,7 @@
 {
 	vfs_file_t *file = vfs_file_get(fd);
-	if (!file) {
-		return EBADF;
-	}
+	if (!file)
+		return EBADF;
+
 	assert(file->node);
 	
@@ -182,10 +177,9 @@
 	
 	fibril_mutex_lock(&fs_list_lock);
-	while (1) {
+	while (true) {
 		fs_handle = fs_name_to_handle(instance, fsname, false);
 		
-		if (fs_handle != 0 || !(flags & VFS_MOUNT_BLOCKING)) {
+		if (fs_handle != 0 || !(flags & VFS_MOUNT_BLOCKING))
 			break;
-		}
 		
 		fibril_condvar_wait(&fs_list_cv, &fs_list_lock);
@@ -193,7 +187,6 @@
 	fibril_mutex_unlock(&fs_list_lock);
 
-	if (fs_handle == 0) {
+	if (fs_handle == 0)
 		return ENOENT;
-	}
 	
 	/* Tell the mountee that it is being mounted. */
@@ -212,7 +205,6 @@
 	vfs_exchange_release(exch);
 	
-	if (rc != EOK) {
+	if (rc != EOK)
 		return rc;
-	}
 	
 	vfs_lookup_res_t res;
@@ -284,7 +276,6 @@
 	fibril_rwlock_write_unlock(&namespace_rwlock);
 	
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto out;
-	}
 	
 	if (flags & VFS_MOUNT_NO_REF) {
@@ -300,10 +291,9 @@
 	
 out:
-	if (mp) {
+	if (mp)
 		vfs_file_put(mp);
-	}
-	if (file) {
-		vfs_file_put(file);
-	}
+	if (file)
+		vfs_file_put(file);
+
 	if (rc != EOK && fd >= 0) {
 		vfs_fd_free(fd);
@@ -317,12 +307,10 @@
 int vfs_op_open2(int fd, int flags)
 {
-	if (flags == 0) {
+	if (flags == 0)
 		return EINVAL;
-	}
 
 	vfs_file_t *file = vfs_file_get(fd);
-	if (!file) {
-		return EBADF;
-	}
+	if (!file)
+		return EBADF;
 	
 	if ((flags & ~file->permissions) != 0) {
@@ -454,9 +442,8 @@
 	 * write implementation does not modify the file size.
 	 */
-	if (rlock) {
+	if (rlock)
 		fibril_rwlock_read_lock(&file->node->contents_rwlock);
-	} else {
+	else
 		fibril_rwlock_write_lock(&file->node->contents_rwlock);
-	}
 	
 	if (file->node->type == VFS_NODE_DIRECTORY) {
@@ -496,7 +483,6 @@
 	size_t bytes = IPC_GET_ARG1(answer);
 	
-	if (file->node->type == VFS_NODE_DIRECTORY) {
+	if (file->node->type == VFS_NODE_DIRECTORY)
 		fibril_rwlock_read_unlock(&namespace_rwlock);
-	}
 	
 	/* Unlock the VFS node. */
@@ -513,7 +499,6 @@
 	
 	/* Update the position pointer and unlock the open file. */
-	if (rc == EOK) {
+	if (rc == EOK)
 		file->pos += bytes;
-	}
 	vfs_file_put(file);	
 
@@ -534,7 +519,7 @@
 {
 	vfs_file_t *base_file = vfs_file_get(basefd);
-	if (!base_file) {
-		return EBADF;
-	}
+	if (!base_file)
+		return EBADF;
+
 	vfs_node_t *base = base_file->node;
 	vfs_node_addref(base);
@@ -577,6 +562,5 @@
 	}
 
-	rc = vfs_lookup_internal(base, old, L_DISABLE_MOUNTS,
-	    &old_lr);
+	rc = vfs_lookup_internal(base, old, L_DISABLE_MOUNTS, &old_lr);
 	if (rc != EOK) {
 		vfs_node_put(base);
@@ -598,7 +582,6 @@
 	if (rc != EOK) {
 		vfs_link_internal(base, old, &old_lr.triplet);
-		if (orig_unlinked) {
+		if (orig_unlinked)
 			vfs_link_internal(base, new, &new_lr_orig.triplet);
-		}
 		vfs_node_put(base);
 		fibril_rwlock_write_unlock(&namespace_rwlock);
@@ -609,7 +592,6 @@
 	    &old_lr);
 	if (rc != EOK) {
-		if (orig_unlinked) {
+		if (orig_unlinked)
 			vfs_link_internal(base, new, &new_lr_orig.triplet);
-		}
 		vfs_node_put(base);
 		fibril_rwlock_write_unlock(&namespace_rwlock);
@@ -634,7 +616,6 @@
 {
 	vfs_file_t *file = vfs_file_get(fd);
-	if (!file) {
-		return EBADF;
-	}
+	if (!file)
+		return EBADF;
 	
 	switch (whence) {
@@ -724,7 +705,6 @@
 {
 	vfs_file_t *file = vfs_file_get(fd);
-	if (!file) {
-		return EBADF;
-	}
+	if (!file)
+		return EBADF;
 	
 	async_exch_t *fs_exch = vfs_exchange_grab(file->node->fs_handle);
@@ -733,5 +713,5 @@
 	ipc_call_t answer;
 	msg = async_send_2(fs_exch, VFS_OUT_SYNC, file->node->service_id,
-		file->node->index, &answer);
+	    file->node->index, &answer);
 	
 	vfs_exchange_release(fs_exch);
@@ -760,15 +740,13 @@
 {
 	vfs_file_t *file = vfs_file_get(fd);
-	if (!file) {
-		return EBADF;
-	}
+	if (!file)
+		return EBADF;
 
 	fibril_rwlock_write_lock(&file->node->contents_rwlock);
 	
 	int rc = vfs_truncate_internal(file->node->fs_handle,
-		file->node->service_id, file->node->index, size);
-	if (rc == EOK) {
+	    file->node->service_id, file->node->index, size);
+	if (rc == EOK)
 		file->node->size = size;
-	}
 	
 	fibril_rwlock_write_unlock(&file->node->contents_rwlock);
@@ -783,11 +761,10 @@
 	vfs_file_t *expect = NULL;
 	
-	if (parentfd == expectfd) {
+	if (parentfd == expectfd)
 		return EINVAL;
-	}
 	
 	fibril_rwlock_write_lock(&namespace_rwlock);
 	
-	int lflag = (wflag&WALK_DIRECTORY) ? L_DIRECTORY: 0;
+	int lflag = (wflag & WALK_DIRECTORY) ? L_DIRECTORY: 0;
 
 	/* 
@@ -824,7 +801,6 @@
 		vfs_lookup_res_t lr;
 		rc = vfs_lookup_internal(parent->node, path, lflag, &lr);
-		if (rc != EOK) {
+		if (rc != EOK)
 			goto exit;
-		}
 		
 		vfs_node_t *found_node = vfs_node_peek(&lr);
@@ -841,7 +817,6 @@
 	vfs_lookup_res_t lr;
 	rc = vfs_lookup_internal(parent->node, path, lflag | L_UNLINK, &lr);
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto exit;
-	}
 
 	/* If the node is not held by anyone, try to destroy it. */
@@ -853,13 +828,10 @@
 
 exit:
-	if (path) {
+	if (path)
 		free(path);
-	}
-	if (parent) {
+	if (parent)
 		vfs_file_put(parent);
-	}
-	if (expect) {
+	if (expect)
 		vfs_file_put(expect);
-	}
 	fibril_rwlock_write_unlock(&namespace_rwlock);
 	return rc;
@@ -869,7 +841,6 @@
 {
 	vfs_file_t *mp = vfs_file_get(mpfd);
-	if (mp == NULL) {
-		return EBADF;
-	}
+	if (mp == NULL)
+		return EBADF;
 	
 	if (mp->node->mount == NULL) {
@@ -922,17 +893,13 @@
 static inline bool walk_flags_valid(int flags)
 {
-	if ((flags & ~WALK_ALL_FLAGS) != 0) {
+	if ((flags & ~WALK_ALL_FLAGS) != 0)
 		return false;
-	}
-	if ((flags & WALK_MAY_CREATE) && (flags & WALK_MUST_CREATE)) {
+	if ((flags & WALK_MAY_CREATE) && (flags & WALK_MUST_CREATE))
 		return false;
-	}
-	if ((flags & WALK_REGULAR) && (flags & WALK_DIRECTORY)) {
+	if ((flags & WALK_REGULAR) && (flags & WALK_DIRECTORY))
 		return false;
-	}
 	if ((flags & WALK_MAY_CREATE) || (flags & WALK_MUST_CREATE)) {
-		if (!(flags & WALK_DIRECTORY) && !(flags & WALK_REGULAR)) {
+		if (!(flags & WALK_DIRECTORY) && !(flags & WALK_REGULAR))
 			return false;
-		}
 	}
 	return true;
@@ -942,19 +909,14 @@
 {
 	int lflags = 0;
-	if ((flags & WALK_MAY_CREATE) || (flags & WALK_MUST_CREATE)) {
+	if ((flags & WALK_MAY_CREATE) || (flags & WALK_MUST_CREATE))
 		lflags |= L_CREATE;
-	}
-	if (flags & WALK_MUST_CREATE) {
+	if (flags & WALK_MUST_CREATE)
 		lflags |= L_EXCLUSIVE;
-	}
-	if (flags & WALK_REGULAR) {
+	if (flags & WALK_REGULAR)
 		lflags |= L_FILE;
-	}
-	if (flags & WALK_DIRECTORY) {
+	if (flags & WALK_DIRECTORY)
 		lflags |= L_DIRECTORY;
-	}
-	if (flags & WALK_MOUNT_POINT) {
+	if (flags & WALK_MOUNT_POINT)
 		lflags |= L_MP;
-	}
 	return lflags;
 }
@@ -962,12 +924,10 @@
 int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
 {
-	if (!walk_flags_valid(flags)) {
+	if (!walk_flags_valid(flags))
 		return EINVAL;
-	}
 	
 	vfs_file_t *parent = vfs_file_get(parentfd);
-	if (!parent) {
-		return EBADF;
-	}
+	if (!parent)
+		return EBADF;
 	
 	fibril_rwlock_read_lock(&namespace_rwlock);
