Index: uspace/lib/fs/libfs.c
===================================================================
--- uspace/lib/fs/libfs.c	(revision a46e56be16ae82f0d007dd26c68b250f3f725ae0)
+++ uspace/lib/fs/libfs.c	(revision cbb37b60574b56acd864c01b9afca6a0ce28867f)
@@ -58,7 +58,7 @@
 	((rc1) == EOK ? (rc2) : (rc1))
 
-#define answer_and_return(rid, rc) \
+#define answer_and_return(chandle, rc) \
 	do { \
-		async_answer_0((rid), (rc)); \
+		async_answer_0((chandle), (rc)); \
 		return; \
 	} while (0)
@@ -75,5 +75,6 @@
 static void libfs_lookup(libfs_ops_t *, fs_handle_t, cap_call_handle_t,
     ipc_call_t *);
-static void libfs_stat(libfs_ops_t *, fs_handle_t, cap_call_handle_t, ipc_call_t *);
+static void libfs_stat(libfs_ops_t *, fs_handle_t, cap_call_handle_t,
+    ipc_call_t *);
 static void libfs_open_node(libfs_ops_t *, fs_handle_t, cap_call_handle_t,
     ipc_call_t *);
@@ -81,5 +82,5 @@
     ipc_call_t *);
 
-static void vfs_out_fsprobe(cap_call_handle_t rid, ipc_call_t *req)
+static void vfs_out_fsprobe(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -92,5 +93,5 @@
 	    (size != sizeof(info))) {
 		async_answer_0(chandle, EIO);
-		async_answer_0(rid, EIO);
+		async_answer_0(req_handle, EIO);
 		return;
 	}
@@ -100,13 +101,13 @@
 	if (rc != EOK) {
 		async_answer_0(chandle, EIO);
-		async_answer_0(rid, rc);
+		async_answer_0(req_handle, rc);
 		return;
 	}
 
 	async_data_read_finalize(chandle, &info, sizeof(info));
-	async_answer_0(rid, EOK);
-}
-
-static void vfs_out_mounted(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, EOK);
+}
+
+static void vfs_out_mounted(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -117,5 +118,5 @@
 	rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		async_answer_0(rid, rc);
+		async_answer_0(req_handle, rc);
 		return;
 	}
@@ -125,13 +126,14 @@
 	rc = vfs_out_ops->mounted(service_id, opts, &index, &size);
 
-	if (rc == EOK)
-		async_answer_3(rid, EOK, index, LOWER32(size), UPPER32(size));
-	else
-		async_answer_0(rid, rc);
+	if (rc == EOK) {
+		async_answer_3(req_handle, EOK, index, LOWER32(size),
+		    UPPER32(size));
+	} else
+		async_answer_0(req_handle, rc);
 
 	free(opts);
 }
 
-static void vfs_out_unmounted(cap_call_handle_t rid, ipc_call_t *req)
+static void vfs_out_unmounted(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -140,18 +142,18 @@
 	rc = vfs_out_ops->unmounted(service_id);
 
-	async_answer_0(rid, rc);
-}
-
-static void vfs_out_link(cap_call_handle_t rid, ipc_call_t *req)
-{
-	libfs_link(libfs_ops, reg.fs_handle, rid, req);
-}
-
-static void vfs_out_lookup(cap_call_handle_t rid, ipc_call_t *req)
-{
-	libfs_lookup(libfs_ops, reg.fs_handle, rid, req);
-}
-
-static void vfs_out_read(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_link(cap_call_handle_t req_handle, ipc_call_t *req)
+{
+	libfs_link(libfs_ops, reg.fs_handle, req_handle, req);
+}
+
+static void vfs_out_lookup(cap_call_handle_t req_handle, ipc_call_t *req)
+{
+	libfs_lookup(libfs_ops, reg.fs_handle, req_handle, req);
+}
+
+static void vfs_out_read(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -165,10 +167,10 @@
 
 	if (rc == EOK)
-		async_answer_1(rid, EOK, rbytes);
+		async_answer_1(req_handle, EOK, rbytes);
 	else
-		async_answer_0(rid, rc);
-}
-
-static void vfs_out_write(cap_call_handle_t rid, ipc_call_t *req)
+		async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_write(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -183,11 +185,11 @@
 
 	if (rc == EOK) {
-		async_answer_3(rid, EOK, wbytes, LOWER32(nsize),
+		async_answer_3(req_handle, EOK, wbytes, LOWER32(nsize),
 		    UPPER32(nsize));
 	} else
-		async_answer_0(rid, rc);
-}
-
-static void vfs_out_truncate(cap_call_handle_t rid, ipc_call_t *req)
+		async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_truncate(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -199,8 +201,8 @@
 	rc = vfs_out_ops->truncate(service_id, index, size);
 
-	async_answer_0(rid, rc);
-}
-
-static void vfs_out_close(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_close(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -210,8 +212,8 @@
 	rc = vfs_out_ops->close(service_id, index);
 
-	async_answer_0(rid, rc);
-}
-
-static void vfs_out_destroy(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_destroy(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -227,18 +229,18 @@
 			rc = vfs_out_ops->destroy(service_id, index);
 	}
-	async_answer_0(rid, rc);
-}
-
-static void vfs_out_open_node(cap_call_handle_t rid, ipc_call_t *req)
-{
-	libfs_open_node(libfs_ops, reg.fs_handle, rid, req);
-}
-
-static void vfs_out_stat(cap_call_handle_t rid, ipc_call_t *req)
-{
-	libfs_stat(libfs_ops, reg.fs_handle, rid, req);
-}
-
-static void vfs_out_sync(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_open_node(cap_call_handle_t req_handle, ipc_call_t *req)
+{
+	libfs_open_node(libfs_ops, reg.fs_handle, req_handle, req);
+}
+
+static void vfs_out_stat(cap_call_handle_t req_handle, ipc_call_t *req)
+{
+	libfs_stat(libfs_ops, reg.fs_handle, req_handle, req);
+}
+
+static void vfs_out_sync(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -248,13 +250,13 @@
 	rc = vfs_out_ops->sync(service_id, index);
 
-	async_answer_0(rid, rc);
-}
-
-static void vfs_out_statfs(cap_call_handle_t rid, ipc_call_t *req)
-{
-	libfs_statfs(libfs_ops, reg.fs_handle, rid, req);
-}
-
-static void vfs_out_is_empty(cap_call_handle_t rid, ipc_call_t *req)
+	async_answer_0(req_handle, rc);
+}
+
+static void vfs_out_statfs(cap_call_handle_t req_handle, ipc_call_t *req)
+{
+	libfs_statfs(libfs_ops, reg.fs_handle, req_handle, req);
+}
+
+static void vfs_out_is_empty(cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
@@ -265,7 +267,7 @@
 	rc = libfs_ops->node_get(&node, service_id, index);
 	if (rc != EOK)
-		async_answer_0(rid, rc);
+		async_answer_0(req_handle, rc);
 	if (node == NULL)
-		async_answer_0(rid, EINVAL);
+		async_answer_0(req_handle, EINVAL);
 
 	bool children = false;
@@ -274,9 +276,10 @@
 
 	if (rc != EOK)
-		async_answer_0(rid, rc);
-	async_answer_0(rid, children ? ENOTEMPTY : EOK);
-}
-
-static void vfs_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
+		async_answer_0(req_handle, rc);
+	async_answer_0(req_handle, children ? ENOTEMPTY : EOK);
+}
+
+static void vfs_connection(cap_call_handle_t icall_handle, ipc_call_t *icall,
+    void *arg)
 {
 	if (icall_handle) {
@@ -492,6 +495,6 @@
 /** Link a file at a path.
  */
-void libfs_link(libfs_ops_t *ops, fs_handle_t fs_handle, cap_call_handle_t rid,
-    ipc_call_t *req)
+void libfs_link(libfs_ops_t *ops, fs_handle_t fs_handle,
+    cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	service_id_t parent_sid = IPC_GET_ARG1(*req);
@@ -502,5 +505,5 @@
 	errno_t rc = receive_fname(component);
 	if (rc != EOK) {
-		async_answer_0(rid, rc);
+		async_answer_0(req_handle, rc);
 		return;
 	}
@@ -509,5 +512,5 @@
 	rc = ops->node_get(&parent, parent_sid, parent_index);
 	if (parent == NULL) {
-		async_answer_0(rid, rc == EOK ? EBADF : rc);
+		async_answer_0(req_handle, rc == EOK ? EBADF : rc);
 		return;
 	}
@@ -516,5 +519,5 @@
 	rc = ops->node_get(&child, parent_sid, child_index);
 	if (child == NULL) {
-		async_answer_0(rid, rc == EOK ? EBADF : rc);
+		async_answer_0(req_handle, rc == EOK ? EBADF : rc);
 		ops->node_put(parent);
 		return;
@@ -524,5 +527,5 @@
 	ops->node_put(parent);
 	ops->node_put(child);
-	async_answer_0(rid, rc);
+	async_answer_0(req_handle, rc);
 }
 
@@ -532,14 +535,14 @@
  * as returned by the canonify() function.
  *
- * @param ops       libfs operations structure with function pointers to
- *                  file system implementation
- * @param fs_handle File system handle of the file system where to perform
- *                  the lookup.
- * @param rid       Request ID of the VFS_OUT_LOOKUP request.
- * @param request   VFS_OUT_LOOKUP request data itself.
+ * @param ops         libfs operations structure with function pointers to
+ *                    file system implementation
+ * @param fs_handle   File system handle of the file system where to perform
+ *                    the lookup.
+ * @param req_handle  Call handle of the VFS_OUT_LOOKUP request.
+ * @param request     VFS_OUT_LOOKUP request data itself.
  *
  */
-void libfs_lookup(libfs_ops_t *ops, fs_handle_t fs_handle, cap_call_handle_t rid,
-    ipc_call_t *req)
+void libfs_lookup(libfs_ops_t *ops, fs_handle_t fs_handle,
+    cap_call_handle_t req_handle, ipc_call_t *req)
 {
 	unsigned first = IPC_GET_ARG1(*req);
@@ -564,5 +567,5 @@
 	rc = ops->node_get(&cur, service_id, index);
 	if (rc != EOK) {
-		async_answer_0(rid, rc);
+		async_answer_0(req_handle, rc);
 		goto out;
 	}
@@ -581,5 +584,5 @@
 
 		if (!ops->is_directory(cur)) {
-			async_answer_0(rid, ENOTDIR);
+			async_answer_0(req_handle, ENOTDIR);
 			goto out;
 		}
@@ -590,5 +593,5 @@
 		assert(rc != ERANGE);
 		if (rc != EOK) {
-			async_answer_0(rid, rc);
+			async_answer_0(req_handle, rc);
 			goto out;
 		}
@@ -604,5 +607,5 @@
 		rc = ops->match(&tmp, cur, component);
 		if (rc != EOK) {
-			async_answer_0(rid, rc);
+			async_answer_0(req_handle, rc);
 			goto out;
 		}
@@ -612,5 +615,5 @@
 			rc = ops->node_put(par);
 			if (rc != EOK) {
-				async_answer_0(rid, rc);
+				async_answer_0(req_handle, rc);
 				goto out;
 			}
@@ -632,10 +635,10 @@
 
 	if (cur && (lflag & L_FILE) && (ops->is_directory(cur))) {
-		async_answer_0(rid, EISDIR);
+		async_answer_0(req_handle, EISDIR);
 		goto out;
 	}
 
 	if (cur && (lflag & L_DIRECTORY) && (ops->is_file(cur))) {
-		async_answer_0(rid, ENOTDIR);
+		async_answer_0(req_handle, ENOTDIR);
 		goto out;
 	}
@@ -645,9 +648,9 @@
 	if (lflag & L_UNLINK) {
 		if (!cur) {
-			async_answer_0(rid, ENOENT);
+			async_answer_0(req_handle, ENOENT);
 			goto out;
 		}
 		if (!par) {
-			async_answer_0(rid, EINVAL);
+			async_answer_0(req_handle, EINVAL);
 			goto out;
 		}
@@ -656,10 +659,10 @@
 		if (rc == EOK) {
 			aoff64_t size = ops->size_get(cur);
-			async_answer_5(rid, EOK, fs_handle,
+			async_answer_5(req_handle, EOK, fs_handle,
 			    ops->index_get(cur),
 			    (ops->is_directory(cur) << 16) | last,
 			    LOWER32(size), UPPER32(size));
 		} else {
-			async_answer_0(rid, rc);
+			async_answer_0(req_handle, rc);
 		}
 		goto out;
@@ -670,5 +673,5 @@
 	if (lflag & L_CREATE) {
 		if (cur && (lflag & L_EXCLUSIVE)) {
-			async_answer_0(rid, EEXIST);
+			async_answer_0(req_handle, EEXIST);
 			goto out;
 		}
@@ -678,9 +681,9 @@
 			    lflag & (L_FILE | L_DIRECTORY));
 			if (rc != EOK) {
-				async_answer_0(rid, rc);
+				async_answer_0(req_handle, rc);
 				goto out;
 			}
 			if (!cur) {
-				async_answer_0(rid, ENOSPC);
+				async_answer_0(req_handle, ENOSPC);
 				goto out;
 			}
@@ -690,5 +693,5 @@
 				(void) ops->destroy(cur);
 				cur = NULL;
-				async_answer_0(rid, rc);
+				async_answer_0(req_handle, rc);
 				goto out;
 			}
@@ -699,5 +702,5 @@
 out1:
 	if (!cur) {
-		async_answer_5(rid, EOK, fs_handle, ops->index_get(par),
+		async_answer_5(req_handle, EOK, fs_handle, ops->index_get(par),
 		    (ops->is_directory(par) << 16) | last_next,
 		    LOWER32(ops->size_get(par)), UPPER32(ops->size_get(par)));
@@ -705,5 +708,5 @@
 	}
 
-	async_answer_5(rid, EOK, fs_handle, ops->index_get(cur),
+	async_answer_5(req_handle, EOK, fs_handle, ops->index_get(cur),
 	    (ops->is_directory(cur) << 16) | last, LOWER32(ops->size_get(cur)),
 	    UPPER32(ops->size_get(cur)));
@@ -720,6 +723,6 @@
 }
 
-void libfs_stat(libfs_ops_t *ops, fs_handle_t fs_handle, cap_call_handle_t rid,
-    ipc_call_t *request)
+void libfs_stat(libfs_ops_t *ops, fs_handle_t fs_handle,
+    cap_call_handle_t req_handle, ipc_call_t *request)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
@@ -728,5 +731,5 @@
 	fs_node_t *fn;
 	errno_t rc = ops->node_get(&fn, service_id, index);
-	on_error(rc, answer_and_return(rid, rc));
+	on_error(rc, answer_and_return(req_handle, rc));
 
 	cap_call_handle_t chandle;
@@ -736,5 +739,5 @@
 		ops->node_put(fn);
 		async_answer_0(chandle, EINVAL);
-		async_answer_0(rid, EINVAL);
+		async_answer_0(req_handle, EINVAL);
 		return;
 	}
@@ -756,9 +759,9 @@
 
 	async_data_read_finalize(chandle, &stat, sizeof(vfs_stat_t));
-	async_answer_0(rid, EOK);
-}
-
-void libfs_statfs(libfs_ops_t *ops, fs_handle_t fs_handle, cap_call_handle_t rid,
-    ipc_call_t *request)
+	async_answer_0(req_handle, EOK);
+}
+
+void libfs_statfs(libfs_ops_t *ops, fs_handle_t fs_handle,
+    cap_call_handle_t req_handle, ipc_call_t *request)
 {
 	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
@@ -767,5 +770,5 @@
 	fs_node_t *fn;
 	errno_t rc = ops->node_get(&fn, service_id, index);
-	on_error(rc, answer_and_return(rid, rc));
+	on_error(rc, answer_and_return(req_handle, rc));
 
 	cap_call_handle_t chandle;
@@ -801,5 +804,5 @@
 	ops->node_put(fn);
 	async_data_read_finalize(chandle, &st, sizeof(vfs_statfs_t));
-	async_answer_0(rid, EOK);
+	async_answer_0(req_handle, EOK);
 	return;
 
@@ -807,5 +810,5 @@
 	ops->node_put(fn);
 	async_answer_0(chandle, EINVAL);
-	async_answer_0(rid, EINVAL);
+	async_answer_0(req_handle, EINVAL);
 }
 
@@ -813,12 +816,12 @@
 /** Open VFS triplet.
  *
- * @param ops     libfs operations structure with function pointers to
- *                file system implementation
- * @param rid     Request ID of the VFS_OUT_OPEN_NODE request.
- * @param request VFS_OUT_OPEN_NODE request data itself.
+ * @param ops         libfs operations structure with function pointers to
+ *                    file system implementation
+ * @param req_handle  Call handle of the VFS_OUT_OPEN_NODE request.
+ * @param request     VFS_OUT_OPEN_NODE request data itself.
  *
  */
-void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, cap_call_handle_t rid,
-    ipc_call_t *request)
+void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle,
+    cap_call_handle_t req_handle, ipc_call_t *request)
 {
 	service_id_t service_id = IPC_GET_ARG1(*request);
@@ -827,8 +830,8 @@
 	fs_node_t *fn;
 	errno_t rc = ops->node_get(&fn, service_id, index);
-	on_error(rc, answer_and_return(rid, rc));
+	on_error(rc, answer_and_return(req_handle, rc));
 
 	if (fn == NULL) {
-		async_answer_0(rid, ENOENT);
+		async_answer_0(req_handle, ENOENT);
 		return;
 	}
@@ -836,5 +839,5 @@
 	rc = ops->node_open(fn);
 	aoff64_t size = ops->size_get(fn);
-	async_answer_4(rid, rc, LOWER32(size), UPPER32(size),
+	async_answer_4(req_handle, rc, LOWER32(size), UPPER32(size),
 	    ops->lnkcnt_get(fn),
 	    (ops->is_file(fn) ? L_FILE : 0) |
