Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/srv/vfs/vfs_ops.c	(revision 34e1206ec4dc79f0592077e3ee270fba91d1eb9d)
@@ -64,11 +64,11 @@
 {
 	size_t res = 0;
-	
+
 	while (a[res] == b[res] && a[res] != 0)
 		res++;
-	
+
 	if (a[res] == b[res])
 		return res;
-	
+
 	res--;
 	while (a[res] != '/')
@@ -93,5 +93,5 @@
 	if (oldfd == newfd)
 		return EOK;
-	
+
 	/* Lookup the file structure corresponding to fd. */
 	vfs_file_t *oldfile = vfs_file_get(oldfd);
@@ -112,10 +112,10 @@
 			newfile->permissions = oldfile->permissions;
 			vfs_node_addref(newfile->node);
-	
+
 			vfs_file_put(newfile);
 		}
 	}
 	vfs_file_put(oldfile);
-	
+
 	return rc;
 }
@@ -131,12 +131,12 @@
 {
 	fs_handle_t fs_handle = 0;
-	
+
 	fibril_mutex_lock(&fs_list_lock);
 	while (true) {
 		fs_handle = fs_name_to_handle(instance, fsname, false);
-		
+
 		if (fs_handle != 0 || !(flags & VFS_MOUNT_BLOCKING))
 			break;
-		
+
 		fibril_condvar_wait(&fs_list_cv, &fs_list_lock);
 	}
@@ -145,5 +145,5 @@
 	if (fs_handle == 0)
 		return ENOFS;
-	
+
 	/* Tell the mountee that it is being mounted. */
 	ipc_call_t answer;
@@ -164,5 +164,5 @@
 		return rc;
 	}
-	
+
 	vfs_lookup_res_t res;
 	res.triplet.fs_handle = fs_handle;
@@ -172,5 +172,5 @@
 	    IPC_GET_ARG3(answer));
 	res.type = VFS_NODE_DIRECTORY;
-	
+
 	/* Add reference to the mounted root. */
 	*root = vfs_node_get(&res);
@@ -182,5 +182,5 @@
 		return ENOMEM;
 	}
-			
+
 	vfs_exchange_release(exch);
 
@@ -194,12 +194,12 @@
 	errno_t rc;
 	errno_t retval;
-	
+
 	fibril_mutex_lock(&fs_list_lock);
 	fs_handle = fs_name_to_handle(0, fs_name, false);
 	fibril_mutex_unlock(&fs_list_lock);
-	
+
 	if (fs_handle == 0)
 		return ENOFS;
-	
+
 	/* Send probe request to the file system server */
 	ipc_call_t answer;
@@ -209,5 +209,5 @@
 	if (msg == 0)
 		return EINVAL;
-	
+
 	/* Read probe information */
 	retval = async_data_read_start(exch, info, sizeof(*info));
@@ -216,5 +216,5 @@
 		return retval;
 	}
-	
+
 	async_wait_for(msg, &rc);
 	vfs_exchange_release(exch);
@@ -229,5 +229,5 @@
 	vfs_file_t *file = NULL;
 	*out_fd = -1;
-	
+
 	if (!(flags & VFS_MOUNT_CONNECT_ONLY)) {
 		mp = vfs_file_get(mpfd);
@@ -236,15 +236,15 @@
 			goto out;
 		}
-		
+
 		if (mp->node->mount != NULL) {
 			rc = EBUSY;
 			goto out;
 		}
-		
+
 		if (mp->node->type != VFS_NODE_DIRECTORY) {
 			rc = ENOTDIR;
 			goto out;
 		}
-		
+
 		if (vfs_node_has_children(mp->node)) {
 			rc = ENOTEMPTY;
@@ -252,5 +252,5 @@
 		}
 	}
-	
+
 	if (!(flags & VFS_MOUNT_NO_REF)) {
 		rc = vfs_fd_alloc(&file, false, out_fd);
@@ -259,7 +259,7 @@
 		}
 	}
-	
+
 	vfs_node_t *root = NULL;
-	
+
 	fibril_rwlock_write_lock(&namespace_rwlock);
 
@@ -271,15 +271,15 @@
 		mp->node->mount = root;
 	}
-	
+
 	fibril_rwlock_write_unlock(&namespace_rwlock);
-	
+
 	if (rc != EOK)
 		goto out;
-	
+
 	if (flags & VFS_MOUNT_NO_REF) {
 		vfs_node_delref(root);
 	} else {
 		assert(file != NULL);
-		
+
 		file->node = root;
 		file->permissions = MODE_READ | MODE_WRITE | MODE_APPEND;
@@ -287,5 +287,5 @@
 		file->open_write = false;
 	}
-	
+
 out:
 	if (mp)
@@ -298,5 +298,5 @@
 		*out_fd = -1;
 	}
-	
+
 	return rc;
 }
@@ -310,24 +310,24 @@
 	if (!file)
 		return EBADF;
-	
+
 	if ((mode & ~file->permissions) != 0) {
 		vfs_file_put(file);
 		return EPERM;
 	}
-	
+
 	if (file->open_read || file->open_write) {
 		vfs_file_put(file);
 		return EBUSY;
 	}
-	
+
 	file->open_read = (mode & MODE_READ) != 0;
 	file->open_write = (mode & (MODE_WRITE | MODE_APPEND)) != 0;
 	file->append = (mode & MODE_APPEND) != 0;
-	
+
 	if (!file->open_read && !file->open_write) {
 		vfs_file_put(file);
 		return EINVAL;
 	}
-	
+
 	if (file->node->type == VFS_NODE_DIRECTORY && file->open_write) {
 		file->open_read = file->open_write = false;
@@ -335,5 +335,5 @@
 		return EINVAL;
 	}
-	
+
 	errno_t rc = vfs_open_node_remote(file->node);
 	if (rc != EOK) {
@@ -342,5 +342,5 @@
 		return rc;
 	}
-	
+
 	vfs_file_put(file);
 	return EOK;
@@ -385,5 +385,5 @@
 	if (exch == NULL)
 		return ENOENT;
-	
+
 	aid_t msg = async_send_fast(exch, read ? VFS_OUT_READ : VFS_OUT_WRITE,
 	    file->node->service_id, file->node->index, LOWER32(pos),
@@ -397,8 +397,8 @@
 		return retval;
 	}
-	
+
 	errno_t rc;
 	async_wait_for(msg, &rc);
-	
+
 	chunk->size = IPC_GET_ARG1(*answer);
 
@@ -418,21 +418,21 @@
 	 * open files supports parallel access!
 	 */
-	
+
 	/* Lookup the file structure corresponding to the file descriptor. */
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file)
 		return EBADF;
-	
+
 	if ((read && !file->open_read) || (!read && !file->open_write)) {
 		vfs_file_put(file);
 		return EINVAL;
 	}
-	
+
 	vfs_info_t *fs_info = fs_handle_to_info(file->node->fs_handle);
 	assert(fs_info);
-	
+
 	bool rlock = read ||
 	    (fs_info->concurrent_read_write && fs_info->write_retains_size);
-	
+
 	/*
 	 * Lock the file's node so that no other client can read/write to it at
@@ -444,5 +444,5 @@
 	else
 		fibril_rwlock_write_lock(&file->node->contents_rwlock);
-	
+
 	if (file->node->type == VFS_NODE_DIRECTORY) {
 		/*
@@ -450,5 +450,5 @@
 		 * while we are in readdir().
 		 */
-		
+
 		if (!read) {
 			if (rlock) {
@@ -462,13 +462,13 @@
 			return EINVAL;
 		}
-		
+
 		fibril_rwlock_read_lock(&namespace_rwlock);
 	}
-	
+
 	async_exch_t *fs_exch = vfs_exchange_grab(file->node->fs_handle);
-	
+
 	if (!read && file->append)
 		pos = file->node->size;
-	
+
 	/*
 	 * Handle communication with the endpoint FS.
@@ -476,10 +476,10 @@
 	ipc_call_t answer;
 	errno_t rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
-	
+
 	vfs_exchange_release(fs_exch);
-	
+
 	if (file->node->type == VFS_NODE_DIRECTORY)
 		fibril_rwlock_read_unlock(&namespace_rwlock);
-	
+
 	/* Unlock the VFS node. */
 	if (rlock) {
@@ -493,5 +493,5 @@
 		fibril_rwlock_write_unlock(&file->node->contents_rwlock);
 	}
-	
+
 	vfs_file_put(file);
 
@@ -518,14 +518,14 @@
 	vfs_node_addref(base);
 	vfs_file_put(base_file);
-	
+
 	vfs_lookup_res_t base_lr;
 	vfs_lookup_res_t old_lr;
 	vfs_lookup_res_t new_lr_orig;
 	bool orig_unlinked = false;
-	
+
 	errno_t rc;
-	
+
 	size_t shared = shared_path(old, new);
-	
+
 	/* Do not allow one path to be a prefix of the other. */
 	if (old[shared] == 0 || new[shared] == 0) {
@@ -535,7 +535,7 @@
 	assert(old[shared] == '/');
 	assert(new[shared] == '/');
-	
+
 	fibril_rwlock_write_lock(&namespace_rwlock);
-	
+
 	/* Resolve the shared portion of the path first. */
 	if (shared != 0) {
@@ -547,5 +547,5 @@
 			return rc;
 		}
-		
+
 		vfs_node_put(base);
 		base = vfs_node_get(&base_lr);
@@ -565,5 +565,5 @@
 		return rc;
 	}
-		
+
 	rc = vfs_lookup_internal(base, new, L_UNLINK | L_DISABLE_MOUNTS,
 	    &new_lr_orig);
@@ -595,5 +595,5 @@
 		return rc;
 	}
-	
+
 	/* If the node is not held by anyone, try to destroy it. */
 	if (orig_unlinked) {
@@ -604,5 +604,5 @@
 			vfs_node_put(node);
 	}
-	
+
 	vfs_node_put(base);
 	fibril_rwlock_write_unlock(&namespace_rwlock);
@@ -617,10 +617,10 @@
 
 	fibril_rwlock_write_lock(&file->node->contents_rwlock);
-	
+
 	errno_t rc = vfs_truncate_internal(file->node->fs_handle,
 	    file->node->service_id, file->node->index, size);
 	if (rc == EOK)
 		file->node->size = size;
-	
+
 	fibril_rwlock_write_unlock(&file->node->contents_rwlock);
 	vfs_file_put(file);
@@ -640,5 +640,5 @@
 	    node->service_id, node->index, true, 0, NULL);
 	vfs_exchange_release(exch);
-	
+
 	vfs_file_put(file);
 	return rc;
@@ -667,20 +667,20 @@
 	if (!file)
 		return EBADF;
-	
+
 	async_exch_t *fs_exch = vfs_exchange_grab(file->node->fs_handle);
-	
+
 	aid_t msg;
 	ipc_call_t answer;
 	msg = async_send_2(fs_exch, VFS_OUT_SYNC, file->node->service_id,
 	    file->node->index, &answer);
-	
+
 	vfs_exchange_release(fs_exch);
-	
+
 	errno_t rc;
 	async_wait_for(msg, &rc);
-	
+
 	vfs_file_put(file);
 	return rc;
-	
+
 }
 
@@ -693,5 +693,5 @@
 	    UPPER32(size));
 	vfs_exchange_release(exch);
-	
+
 	return (errno_t) rc;
 }
@@ -702,10 +702,10 @@
 	vfs_file_t *parent = NULL;
 	vfs_file_t *expect = NULL;
-	
+
 	if (parentfd == expectfd)
 		return EINVAL;
-	
+
 	fibril_rwlock_write_lock(&namespace_rwlock);
-	
+
 	/*
 	 * Files are retrieved in order of file descriptors, to prevent
@@ -719,5 +719,5 @@
 		}
 	}
-	
+
 	if (expectfd >= 0) {
 		expect = vfs_file_get(expectfd);
@@ -727,5 +727,5 @@
 		}
 	}
-	
+
 	if (parentfd > expectfd) {
 		parent = vfs_file_get(parentfd);
@@ -735,7 +735,7 @@
 		}
 	}
-	
+
 	assert(parent != NULL);
-	
+
 	if (expectfd >= 0) {
 		vfs_lookup_res_t lr;
@@ -743,5 +743,5 @@
 		if (rc != EOK)
 			goto exit;
-		
+
 		vfs_node_t *found_node = vfs_node_peek(&lr);
 		vfs_node_put(found_node);
@@ -750,9 +750,9 @@
 			goto exit;
 		}
-		
+
 		vfs_file_put(expect);
 		expect = NULL;
 	}
-	
+
 	vfs_lookup_res_t lr;
 	rc = vfs_lookup_internal(parent->node, path, L_UNLINK, &lr);
@@ -783,12 +783,12 @@
 	if (mp == NULL)
 		return EBADF;
-	
+
 	if (mp->node->mount == NULL) {
 		vfs_file_put(mp);
 		return ENOENT;
 	}
-	
+
 	fibril_rwlock_write_lock(&namespace_rwlock);
-	
+
 	/*
 	 * Count the total number of references for the mounted file system. We
@@ -804,10 +804,10 @@
 		return EBUSY;
 	}
-	
+
 	async_exch_t *exch = vfs_exchange_grab(mp->node->mount->fs_handle);
 	errno_t rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
 	    mp->node->mount->service_id);
 	vfs_exchange_release(exch);
-	
+
 	if (rc != EOK) {
 		vfs_file_put(mp);
@@ -815,11 +815,11 @@
 		return rc;
 	}
-	
+
 	vfs_node_forget(mp->node->mount);
 	vfs_node_put(mp->node);
 	mp->node->mount = NULL;
-	
+
 	fibril_rwlock_write_unlock(&namespace_rwlock);
-	
+
 	vfs_file_put(mp);
 	return EOK;
@@ -866,11 +866,11 @@
 	if (!walk_flags_valid(flags))
 		return EINVAL;
-	
+
 	vfs_file_t *parent = vfs_file_get(parentfd);
 	if (!parent)
 		return EBADF;
-	
+
 	fibril_rwlock_read_lock(&namespace_rwlock);
-	
+
 	vfs_lookup_res_t lr;
 	errno_t rc = vfs_lookup_internal(parent->node, path,
@@ -881,5 +881,5 @@
 		return rc;
 	}
-	
+
 	vfs_node_t *node = vfs_node_get(&lr);
 	if (!node) {
@@ -888,5 +888,5 @@
 		return ENOMEM;
 	}
-	
+
 	vfs_file_t *file;
 	rc = vfs_fd_alloc(&file, false, out_fd);
@@ -897,13 +897,13 @@
 	}
 	assert(file != NULL);
-	
+
 	file->node = node;
 	file->permissions = parent->permissions;
 	file->open_read = false;
 	file->open_write = false;
-	
+
 	vfs_file_put(file);
 	vfs_file_put(parent);
-	
+
 	fibril_rwlock_read_unlock(&namespace_rwlock);
 
