Index: uspace/srv/fs/exfat/exfat.c
===================================================================
--- uspace/srv/fs/exfat/exfat.c	(revision f1119e5c96a89941ef6cd6a519a6e3af14d93e89)
+++ uspace/srv/fs/exfat/exfat.c	(revision ccfbf71a1eb31e0935871e567fd0e7616fcd07d1)
@@ -40,5 +40,5 @@
 #include "exfat.h"
 #include <ipc/services.h>
-#include <ipc/ns.h>
+#include <ns.h>
 #include <async.h>
 #include <errno.h>
@@ -57,111 +57,20 @@
 };
 
-fs_reg_t exfat_reg;
-
-/**
- * This connection fibril processes VFS requests from VFS.
- *
- * In order to support simultaneous VFS requests, our design is as follows.
- * The connection fibril accepts VFS requests from VFS. If there is only one
- * instance of the fibril, VFS will need to serialize all VFS requests it sends
- * to FAT. To overcome this bottleneck, VFS can send exFAT the IPC_M_CONNECT_ME_TO
- * call. In that case, a new connection fibril will be created, which in turn
- * will accept the call. Thus, a new phone will be opened for VFS.
- *
- * There are few issues with this arrangement. First, VFS can run out of
- * available phones. In that case, VFS can close some other phones or use one
- * phone for more serialized requests. Similarily, exFAT can refuse to duplicate
- * the connection. VFS should then just make use of already existing phones and
- * route its requests through them. To avoid paying the fibril creation price 
- * upon each request, exFAT might want to keep the connections open after the
- * request has been completed.
- */
-static void exfat_connection(ipc_callid_t iid, ipc_call_t *icall)
-{
-	if (iid) {
-		/*
-		 * This only happens for connections opened by
-		 * IPC_M_CONNECT_ME_TO calls as opposed to callback connections
-		 * created by IPC_M_CONNECT_TO_ME.
-		 */
-		async_answer_0(iid, EOK);
-	}
-	
-	dprintf(NAME ": connection opened\n");
-	while (1) {
-		ipc_callid_t callid;
-		ipc_call_t call;
-	
-		callid = async_get_call(&call);
-		switch  (IPC_GET_IMETHOD(call)) {
-		case IPC_M_PHONE_HUNGUP:
-			return;
-		case VFS_OUT_MOUNTED:
-			exfat_mounted(callid, &call);
-			break;
-		case VFS_OUT_MOUNT:
-			exfat_mount(callid, &call);
-			break;
-		case VFS_OUT_UNMOUNTED:
-			exfat_unmounted(callid, &call);
-			break;
-		case VFS_OUT_UNMOUNT:
-			exfat_unmount(callid, &call);
-			break;
-		case VFS_OUT_LOOKUP:
-			exfat_lookup(callid, &call);
-			break;
-		case VFS_OUT_READ:
-			exfat_read(callid, &call);
-			break;
-		case VFS_OUT_WRITE:
-			/* exfat_write(callid, &call); */
-			async_answer_0(callid, ENOTSUP);
-			break;
-		case VFS_OUT_TRUNCATE:
-			/* exfat_truncate(callid, &call); */
-			async_answer_0(callid, ENOTSUP);
-			break;
-		case VFS_OUT_STAT:
-			exfat_stat(callid, &call);
-			break;
-		case VFS_OUT_CLOSE:
-			exfat_close(callid, &call);
-			break;
-		case VFS_OUT_DESTROY:
-			/* exfat_destroy(callid, &call); */
-			async_answer_0(callid, ENOTSUP);
-			break;
-		case VFS_OUT_OPEN_NODE:
-			exfat_open_node(callid, &call);
-			break;
-		case VFS_OUT_SYNC:
-			exfat_sync(callid, &call);
-			break;
-		default:
-			async_answer_0(callid, ENOTSUP);
-			break;
-		}
-	}
-}
-
 int main(int argc, char **argv)
 {
-	int vfs_phone;
-	int rc;
-
 	printf(NAME ": HelenOS exFAT file system server\n");
 
-	rc = exfat_idx_init();
+	int rc = exfat_idx_init();
 	if (rc != EOK)
 		goto err;
 
-	vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
-	if (vfs_phone < EOK) {
+	async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
+	    SERVICE_VFS, 0, 0);
+	if (!vfs_sess) {
 		printf(NAME ": failed to connect to VFS\n");
 		return -1;
 	}
 	
-	rc = fs_register(vfs_phone, &exfat_reg, &exfat_vfs_info, exfat_connection);
+	rc = fs_register(vfs_sess, &exfat_vfs_info, &exfat_ops, &exfat_libfs_ops);
 	if (rc != EOK) {
 		exfat_idx_fini();
@@ -172,4 +81,5 @@
 	task_retval(0);
 	async_manager();
+
 	/* not reached */
 	return 0;
@@ -183,3 +93,3 @@
 /**
  * @}
- */ 
+ */
