Index: uspace/srv/vfs/vfs_ipc.c
===================================================================
--- uspace/srv/vfs/vfs_ipc.c	(revision 7c3fb9bd77e4d2f6c10517a052e567f176fa91ee)
+++ uspace/srv/vfs/vfs_ipc.c	(revision 63d46341182c752620dcc5a2233d205cee1075dd)
@@ -35,22 +35,20 @@
 #include <vfs/canonify.h>
 
-static void vfs_in_clone(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int oldfd = IPC_GET_ARG1(*request);
-	int newfd = IPC_GET_ARG2(*request);
-	bool desc = IPC_GET_ARG3(*request);
+static void vfs_in_clone(ipc_call_t *req)
+{
+	int oldfd = IPC_GET_ARG1(*req);
+	int newfd = IPC_GET_ARG2(*req);
+	bool desc = IPC_GET_ARG3(*req);
 
 	int outfd = -1;
 	errno_t rc = vfs_op_clone(oldfd, newfd, desc, &outfd);
-	async_answer_1(req_handle, rc, outfd);
-}
-
-static void vfs_in_fsprobe(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
+	async_answer_1(req, rc, outfd);
+}
+
+static void vfs_in_fsprobe(ipc_call_t *req)
+{
+	service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req);
 	char *fs_name = NULL;
-	cap_call_handle_t chandle;
 	vfs_fs_probe_info_t info;
-	size_t len;
 	errno_t rc;
 
@@ -62,20 +60,22 @@
 	    FS_NAME_MAXLEN, 0, NULL);
 	if (rc != EOK) {
-		async_answer_0(req_handle, rc);
+		async_answer_0(req, rc);
 		return;
 	}
 
 	rc = vfs_op_fsprobe(fs_name, service_id, &info);
-	async_answer_0(req_handle, rc);
+	async_answer_0(req, rc);
 	if (rc != EOK)
 		goto out;
 
 	/* Now we should get a read request */
-	if (!async_data_read_receive(&chandle, &len))
+	ipc_call_t call;
+	size_t len;
+	if (!async_data_read_receive(&call, &len))
 		goto out;
 
 	if (len > sizeof(info))
 		len = sizeof(info);
-	(void) async_data_read_finalize(chandle, &info, len);
+	(void) async_data_read_finalize(&call, &info, len);
 
 out:
@@ -83,8 +83,6 @@
 }
 
-static void vfs_in_fstypes(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	cap_call_handle_t chandle;
-	size_t len;
+static void vfs_in_fstypes(ipc_call_t *req)
+{
 	vfs_fstypes_t fstypes;
 	errno_t rc;
@@ -92,18 +90,20 @@
 	rc = vfs_get_fstypes(&fstypes);
 	if (rc != EOK) {
-		async_answer_0(req_handle, ENOMEM);
+		async_answer_0(req, ENOMEM);
 		return;
 	}
 
 	/* Send size of the data */
-	async_answer_1(req_handle, EOK, fstypes.size);
+	async_answer_1(req, EOK, fstypes.size);
 
 	/* Now we should get a read request */
-	if (!async_data_read_receive(&chandle, &len))
+	ipc_call_t call;
+	size_t len;
+	if (!async_data_read_receive(&call, &len))
 		goto out;
 
 	if (len > fstypes.size)
 		len = fstypes.size;
-	(void) async_data_read_finalize(chandle, fstypes.buf, len);
+	(void) async_data_read_finalize(&call, fstypes.buf, len);
 
 out:
@@ -111,7 +111,7 @@
 }
 
-static void vfs_in_mount(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int mpfd = IPC_GET_ARG1(*request);
+static void vfs_in_mount(ipc_call_t *req)
+{
+	int mpfd = IPC_GET_ARG1(*req);
 
 	/*
@@ -120,8 +120,8 @@
 	 * in the request.
 	 */
-	service_id_t service_id = (service_id_t) IPC_GET_ARG2(*request);
-
-	unsigned int flags = (unsigned int) IPC_GET_ARG3(*request);
-	unsigned int instance = IPC_GET_ARG4(*request);
+	service_id_t service_id = (service_id_t) IPC_GET_ARG2(*req);
+
+	unsigned int flags = (unsigned int) IPC_GET_ARG3(*req);
+	unsigned int instance = IPC_GET_ARG4(*req);
 
 	char *opts = NULL;
@@ -132,5 +132,5 @@
 	    MAX_MNTOPTS_LEN, 0, NULL);
 	if (rc != EOK) {
-		async_answer_0(req_handle, rc);
+		async_answer_0(req, rc);
 		return;
 	}
@@ -144,5 +144,5 @@
 	if (rc != EOK) {
 		free(opts);
-		async_answer_0(req_handle, rc);
+		async_answer_0(req, rc);
 		return;
 	}
@@ -151,5 +151,5 @@
 	rc = vfs_op_mount(mpfd, service_id, flags, instance, opts, fs_name,
 	    &outfd);
-	async_answer_1(req_handle, rc, outfd);
+	async_answer_1(req, rc, outfd);
 
 	free(opts);
@@ -157,32 +157,32 @@
 }
 
-static void vfs_in_open(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
-	int mode = IPC_GET_ARG2(*request);
+static void vfs_in_open(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
+	int mode = IPC_GET_ARG2(*req);
 
 	errno_t rc = vfs_op_open(fd, mode);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_put(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_put(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
 	errno_t rc = vfs_op_put(fd);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_read(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
-	aoff64_t pos = MERGE_LOUP32(IPC_GET_ARG2(*request),
-	    IPC_GET_ARG3(*request));
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_read(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
+	aoff64_t pos = MERGE_LOUP32(IPC_GET_ARG2(*req),
+	    IPC_GET_ARG3(*req));
 
 	size_t bytes = 0;
 	errno_t rc = vfs_op_read(fd, pos, &bytes);
-	async_answer_1(req_handle, rc, bytes);
-}
-
-static void vfs_in_rename(cap_call_handle_t req_handle, ipc_call_t *request)
+	async_answer_1(req, rc, bytes);
+}
+
+static void vfs_in_rename(ipc_call_t *req)
 {
 	/* The common base directory. */
@@ -192,5 +192,5 @@
 	errno_t rc;
 
-	basefd = IPC_GET_ARG1(*request);
+	basefd = IPC_GET_ARG1(*req);
 
 	/* Retrieve the old path. */
@@ -220,5 +220,5 @@
 
 out:
-	async_answer_0(req_handle, rc);
+	async_answer_0(req, rc);
 
 	if (old)
@@ -228,38 +228,38 @@
 }
 
-static void vfs_in_resize(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
-	int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request));
+static void vfs_in_resize(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
+	int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*req), IPC_GET_ARG3(*req));
 	errno_t rc = vfs_op_resize(fd, size);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_stat(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_stat(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
 	errno_t rc = vfs_op_stat(fd);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_statfs(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = (int) IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_statfs(ipc_call_t *req)
+{
+	int fd = (int) IPC_GET_ARG1(*req);
 
 	errno_t rc = vfs_op_statfs(fd);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_sync(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_sync(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
 	errno_t rc = vfs_op_sync(fd);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_unlink(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int parentfd = IPC_GET_ARG1(*request);
-	int expectfd = IPC_GET_ARG2(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_unlink(ipc_call_t *req)
+{
+	int parentfd = IPC_GET_ARG1(*req);
+	int expectfd = IPC_GET_ARG2(*req);
 
 	char *path;
@@ -268,23 +268,23 @@
 		rc = vfs_op_unlink(parentfd, expectfd, path);
 
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_unmount(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int mpfd = IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_unmount(ipc_call_t *req)
+{
+	int mpfd = IPC_GET_ARG1(*req);
 	errno_t rc = vfs_op_unmount(mpfd);
-	async_answer_0(req_handle, rc);
-}
-
-static void vfs_in_wait_handle(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	bool high_fd = IPC_GET_ARG1(*request);
+	async_answer_0(req, rc);
+}
+
+static void vfs_in_wait_handle(ipc_call_t *req)
+{
+	bool high_fd = IPC_GET_ARG1(*req);
 	int fd = -1;
 	errno_t rc = vfs_op_wait_handle(high_fd, &fd);
-	async_answer_1(req_handle, rc, fd);
-}
-
-static void vfs_in_walk(cap_call_handle_t req_handle, ipc_call_t *request)
+	async_answer_1(req, rc, fd);
+}
+
+static void vfs_in_walk(ipc_call_t *req)
 {
 	/*
@@ -292,6 +292,6 @@
 	 * For defined flags, see <ipc/vfs.h>.
 	 */
-	int parentfd = IPC_GET_ARG1(*request);
-	int flags = IPC_GET_ARG2(*request);
+	int parentfd = IPC_GET_ARG1(*req);
+	int flags = IPC_GET_ARG2(*req);
 
 	int fd = 0;
@@ -302,19 +302,19 @@
 		free(path);
 	}
-	async_answer_1(req_handle, rc, fd);
-}
-
-static void vfs_in_write(cap_call_handle_t req_handle, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
-	aoff64_t pos = MERGE_LOUP32(IPC_GET_ARG2(*request),
-	    IPC_GET_ARG3(*request));
+	async_answer_1(req, rc, fd);
+}
+
+static void vfs_in_write(ipc_call_t *req)
+{
+	int fd = IPC_GET_ARG1(*req);
+	aoff64_t pos = MERGE_LOUP32(IPC_GET_ARG2(*req),
+	    IPC_GET_ARG3(*req));
 
 	size_t bytes = 0;
 	errno_t rc = vfs_op_write(fd, pos, &bytes);
-	async_answer_1(req_handle, rc, bytes);
-}
-
-void vfs_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
+	async_answer_1(req, rc, bytes);
+}
+
+void vfs_connection(ipc_call_t *icall, void *arg)
 {
 	bool cont = true;
@@ -324,9 +324,9 @@
 	 * This call needs to be answered.
 	 */
-	async_answer_0(icall_handle, EOK);
+	async_answer_0(icall, EOK);
 
 	while (cont) {
 		ipc_call_t call;
-		cap_call_handle_t chandle = async_get_call(&call);
+		async_get_call(&call);
 
 		if (!IPC_GET_IMETHOD(call))
@@ -335,60 +335,60 @@
 		switch (IPC_GET_IMETHOD(call)) {
 		case VFS_IN_CLONE:
-			vfs_in_clone(chandle, &call);
+			vfs_in_clone(&call);
 			break;
 		case VFS_IN_FSPROBE:
-			vfs_in_fsprobe(chandle, &call);
+			vfs_in_fsprobe(&call);
 			break;
 		case VFS_IN_FSTYPES:
-			vfs_in_fstypes(chandle, &call);
+			vfs_in_fstypes(&call);
 			break;
 		case VFS_IN_MOUNT:
-			vfs_in_mount(chandle, &call);
+			vfs_in_mount(&call);
 			break;
 		case VFS_IN_OPEN:
-			vfs_in_open(chandle, &call);
+			vfs_in_open(&call);
 			break;
 		case VFS_IN_PUT:
-			vfs_in_put(chandle, &call);
+			vfs_in_put(&call);
 			break;
 		case VFS_IN_READ:
-			vfs_in_read(chandle, &call);
+			vfs_in_read(&call);
 			break;
 		case VFS_IN_REGISTER:
-			vfs_register(chandle, &call);
+			vfs_register(&call);
 			cont = false;
 			break;
 		case VFS_IN_RENAME:
-			vfs_in_rename(chandle, &call);
+			vfs_in_rename(&call);
 			break;
 		case VFS_IN_RESIZE:
-			vfs_in_resize(chandle, &call);
+			vfs_in_resize(&call);
 			break;
 		case VFS_IN_STAT:
-			vfs_in_stat(chandle, &call);
+			vfs_in_stat(&call);
 			break;
 		case VFS_IN_STATFS:
-			vfs_in_statfs(chandle, &call);
+			vfs_in_statfs(&call);
 			break;
 		case VFS_IN_SYNC:
-			vfs_in_sync(chandle, &call);
+			vfs_in_sync(&call);
 			break;
 		case VFS_IN_UNLINK:
-			vfs_in_unlink(chandle, &call);
+			vfs_in_unlink(&call);
 			break;
 		case VFS_IN_UNMOUNT:
-			vfs_in_unmount(chandle, &call);
+			vfs_in_unmount(&call);
 			break;
 		case VFS_IN_WAIT_HANDLE:
-			vfs_in_wait_handle(chandle, &call);
+			vfs_in_wait_handle(&call);
 			break;
 		case VFS_IN_WALK:
-			vfs_in_walk(chandle, &call);
+			vfs_in_walk(&call);
 			break;
 		case VFS_IN_WRITE:
-			vfs_in_write(chandle, &call);
+			vfs_in_write(&call);
 			break;
 		default:
-			async_answer_0(chandle, ENOTSUP);
+			async_answer_0(&call, ENOTSUP);
 			break;
 		}
