Index: .bzrignore
===================================================================
--- .bzrignore	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ .bzrignore	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -97,5 +97,5 @@
 uspace/dist/srv/dp8390
 uspace/dist/srv/eth
-uspace/dist/srv/ext2
+uspace/dist/srv/ext2fs
 uspace/dist/srv/fat
 uspace/dist/srv/fb
@@ -142,5 +142,5 @@
 uspace/srv/devmap/devmap
 uspace/srv/fs/devfs/devfs
-uspace/srv/fs/ext2/ext2
+uspace/srv/fs/ext2fs/ext2fs
 uspace/srv/fs/fat/fat
 uspace/srv/fs/tmpfs/tmpfs
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ boot/Makefile.common	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -98,5 +98,5 @@
 	$(USPACE_PATH)/srv/fs/fat/fat \
 	$(USPACE_PATH)/srv/fs/pipefs/pipefs \
-	$(USPACE_PATH)/srv/fs/ext2/ext2 \
+	$(USPACE_PATH)/srv/fs/ext2fs/ext2fs \
 	$(USPACE_PATH)/srv/taskmon/taskmon \
 	$(USPACE_PATH)/srv/hw/netif/ne2000/ne2000 \
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ uspace/Makefile	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -75,5 +75,5 @@
 	srv/fs/devfs \
 	srv/fs/pipefs \
-	srv/fs/ext2 \
+	srv/fs/ext2fs \
 	srv/hid/adb_mouse \
 	srv/hid/char_mouse \
Index: pace/srv/fs/ext2/Makefile
===================================================================
--- uspace/srv/fs/ext2/Makefile	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# Copyright (c) 2010 Martin Sucha
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-USPACE_PREFIX = ../../..
-LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBEXT2_PREFIX)/libext2.a
-EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX) -I$(LIBEXT2_PREFIX)
-BINARY = ext2
-
-SOURCES = \
-	ext2.c \
-	ext2_ops.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: pace/srv/fs/ext2/ext2.c
===================================================================
--- uspace/srv/fs/ext2/ext2.c	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ 	(revision )
@@ -1,166 +1,0 @@
-/*
- * Copyright (c) 2006 Martin Decky
- * Copyright (c) 2008 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup fs
- * @{
- */ 
-
-/**
- * @file	ext2.c
- * @brief	EXT2 file system driver for HelenOS.
- */
-
-#include "ext2.h"
-#include <ipc/services.h>
-#include <ipc/ns.h>
-#include <async.h>
-#include <errno.h>
-#include <unistd.h>
-#include <task.h>
-#include <stdio.h>
-#include <libfs.h>
-#include "../../vfs/vfs.h"
-
-#define NAME	"ext2"
-
-vfs_info_t ext2_vfs_info = {
-	.name = NAME,
-};
-
-fs_reg_t ext2_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 EXT2. To overcome this bottleneck, VFS can send EXT2 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, EXT2 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, EXT2 might want to keep the connections open after the
- * request has been completed.
- */
-static void ext2_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:
-			ext2_mounted(callid, &call);
-			break;
-		case VFS_OUT_MOUNT:
-			ext2_mount(callid, &call);
-			break;
-		case VFS_OUT_UNMOUNTED:
-			ext2_unmounted(callid, &call);
-			break;
-		case VFS_OUT_UNMOUNT:
-			ext2_unmount(callid, &call);
-			break;
-		case VFS_OUT_LOOKUP:
-			ext2_lookup(callid, &call);
-			break;
-		case VFS_OUT_READ:
-			ext2_read(callid, &call);
-			break;
-		case VFS_OUT_WRITE:
-			ext2_write(callid, &call);
-			break;
-		case VFS_OUT_TRUNCATE:
-			ext2_truncate(callid, &call);
-			break;
-		case VFS_OUT_STAT:
-			ext2_stat(callid, &call);
-			break;
-		case VFS_OUT_CLOSE:
-			ext2_close(callid, &call);
-			break;
-		case VFS_OUT_DESTROY:
-			ext2_destroy(callid, &call);
-			break;
-		case VFS_OUT_OPEN_NODE:
-			ext2_open_node(callid, &call);
-			break;
-		case VFS_OUT_SYNC:
-			ext2_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 EXT2 file system server\n");
-
-	vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
-	if (vfs_phone < EOK) {
-		printf(NAME ": failed to connect to VFS\n");
-		return -1;
-	}
-	
-	rc = fs_register(vfs_phone, &ext2_reg, &ext2_vfs_info, ext2_connection);
-	
-	printf(NAME ": Accepting connections\n");
-	task_retval(0);
-	async_manager();
-	/* not reached */
-	return 0;
-}
-
-/**
- * @}
- */ 
Index: pace/srv/fs/ext2/ext2.h
===================================================================
--- uspace/srv/fs/ext2/ext2.h	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*
- * Copyright (c) 2008 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup fs
- * @{
- */ 
-
-#ifndef EXT2_EXT2_H_
-#define EXT2_EXT2_H_
-
-#include <libext2.h>
-#include <fibril_synch.h>
-#include <libfs.h>
-#include <atomic.h>
-#include <sys/types.h>
-#include <bool.h>
-#include "../../vfs/vfs.h"
-
-#ifndef dprintf
-#define dprintf(...)	printf(__VA_ARGS__)
-#endif
-
-#define min(a, b)		((a) < (b) ? (a) : (b))
-
-extern fs_reg_t ext2_reg;
-
-extern void ext2_mounted(ipc_callid_t, ipc_call_t *);
-extern void ext2_mount(ipc_callid_t, ipc_call_t *);
-extern void ext2_unmounted(ipc_callid_t, ipc_call_t *);
-extern void ext2_unmount(ipc_callid_t, ipc_call_t *);
-extern void ext2_lookup(ipc_callid_t, ipc_call_t *);
-extern void ext2_read(ipc_callid_t, ipc_call_t *);
-extern void ext2_write(ipc_callid_t, ipc_call_t *);
-extern void ext2_truncate(ipc_callid_t, ipc_call_t *);
-extern void ext2_stat(ipc_callid_t, ipc_call_t *);
-extern void ext2_close(ipc_callid_t, ipc_call_t *);
-extern void ext2_destroy(ipc_callid_t, ipc_call_t *);
-extern void ext2_open_node(ipc_callid_t, ipc_call_t *);
-extern void ext2_stat(ipc_callid_t, ipc_call_t *);
-extern void ext2_sync(ipc_callid_t, ipc_call_t *);
-
-#endif
-
-/**
- * @}
- */
Index: pace/srv/fs/ext2/ext2_ops.c
===================================================================
--- uspace/srv/fs/ext2/ext2_ops.c	(revision 9ffbdf145d39e6ae279fab6fcaf7b49ac229eecc)
+++ 	(revision )
@@ -1,313 +1,0 @@
-/*
- * Copyright (c) 2008 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup fs
- * @{
- */ 
-
-/**
- * @file	ext2_ops.c
- * @brief	Implementation of VFS operations for the EXT2 file system server.
- */
-
-#include "ext2.h"
-#include "../../vfs/vfs.h"
-#include <libfs.h>
-#include <libblock.h>
-#include <libext2.h>
-#include <ipc/services.h>
-#include <ipc/devmap.h>
-#include <macros.h>
-#include <async.h>
-#include <errno.h>
-#include <str.h>
-#include <byteorder.h>
-#include <adt/hash_table.h>
-#include <adt/list.h>
-#include <assert.h>
-#include <fibril_synch.h>
-#include <sys/mman.h>
-#include <align.h>
-
-#define EXT2_NODE(node)	((node) ? (ext2_node_t *) (node)->data : NULL)
-#define FS_NODE(node)	((node) ? (node)->bp : NULL)
-
-/*
- * Forward declarations of EXT2 libfs operations.
- */
-static int ext2_root_get(fs_node_t **, devmap_handle_t);
-static int ext2_match(fs_node_t **, fs_node_t *, const char *);
-static int ext2_node_get(fs_node_t **, devmap_handle_t, fs_index_t);
-static int ext2_node_open(fs_node_t *);
-static int ext2_node_put(fs_node_t *);
-static int ext2_create_node(fs_node_t **, devmap_handle_t, int);
-static int ext2_destroy_node(fs_node_t *);
-static int ext2_link(fs_node_t *, fs_node_t *, const char *);
-static int ext2_unlink(fs_node_t *, fs_node_t *, const char *);
-static int ext2_has_children(bool *, fs_node_t *);
-static fs_index_t ext2_index_get(fs_node_t *);
-static aoff64_t ext2_size_get(fs_node_t *);
-static unsigned ext2_lnkcnt_get(fs_node_t *);
-static char ext2_plb_get_char(unsigned);
-static bool ext2_is_directory(fs_node_t *);
-static bool ext2_is_file(fs_node_t *node);
-static devmap_handle_t ext2_device_get(fs_node_t *node);
-
-/*
- * EXT2 libfs operations.
- */
-
-int ext2_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
-{
-	// TODO
-	return 0;
-	//return ext2_node_get(rfn, devmap_handle, 0);
-}
-
-int ext2_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-/** Instantiate a EXT2 in-core node. */
-int ext2_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_node_open(fs_node_t *fn)
-{
-	/*
-	 * Opening a file is stateless, nothing
-	 * to be done here.
-	 */
-	return EOK;
-}
-
-int ext2_node_put(fs_node_t *fn)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_destroy_node(fs_node_t *fn)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-int ext2_has_children(bool *has_children, fs_node_t *fn)
-{
-	// TODO
-	return ENOTSUP;
-}
-
-
-fs_index_t ext2_index_get(fs_node_t *fn)
-{
-	// TODO
-	return 0;
-}
-
-aoff64_t ext2_size_get(fs_node_t *fn)
-{
-	// TODO
-	return 0;
-}
-
-unsigned ext2_lnkcnt_get(fs_node_t *fn)
-{
-	// TODO
-	return 0;
-}
-
-char ext2_plb_get_char(unsigned pos)
-{
-	return ext2_reg.plb_ro[pos % PLB_SIZE];
-}
-
-bool ext2_is_directory(fs_node_t *fn)
-{
-	// TODO
-	return false;
-}
-
-bool ext2_is_file(fs_node_t *fn)
-{
-	// TODO
-	return false;
-}
-
-devmap_handle_t ext2_device_get(fs_node_t *node)
-{
-	return 0;
-}
-
-/** libfs operations */
-libfs_ops_t ext2_libfs_ops = {
-	.root_get = ext2_root_get,
-	.match = ext2_match,
-	.node_get = ext2_node_get,
-	.node_open = ext2_node_open,
-	.node_put = ext2_node_put,
-	.create = ext2_create_node,
-	.destroy = ext2_destroy_node,
-	.link = ext2_link,
-	.unlink = ext2_unlink,
-	.has_children = ext2_has_children,
-	.index_get = ext2_index_get,
-	.size_get = ext2_size_get,
-	.lnkcnt_get = ext2_lnkcnt_get,
-	.plb_get_char = ext2_plb_get_char,
-	.is_directory = ext2_is_directory,
-	.is_file = ext2_is_file,
-	.device_get = ext2_device_get
-};
-
-/*
- * VFS operations.
- */
-
-void ext2_mounted(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_mount(ipc_callid_t rid, ipc_call_t *request)
-{
-	libfs_mount(&ext2_libfs_ops, ext2_reg.fs_handle, rid, request);
-}
-
-void ext2_unmounted(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_unmount(ipc_callid_t rid, ipc_call_t *request)
-{
-	libfs_unmount(&ext2_libfs_ops, rid, request);
-}
-
-void ext2_lookup(ipc_callid_t rid, ipc_call_t *request)
-{
-	libfs_lookup(&ext2_libfs_ops, ext2_reg.fs_handle, rid, request);
-}
-
-void ext2_read(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
-//	aoff64_t pos =
-//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
-	
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_write(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
-//	aoff64_t pos =
-//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
-	
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_truncate(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
-//	aoff64_t size =
-//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
-	
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_close(ipc_callid_t rid, ipc_call_t *request)
-{
-	async_answer_0(rid, EOK);
-}
-
-void ext2_destroy(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
-//	fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
-	
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-void ext2_open_node(ipc_callid_t rid, ipc_call_t *request)
-{
-	libfs_open_node(&ext2_libfs_ops, ext2_reg.fs_handle, rid, request);
-}
-
-void ext2_stat(ipc_callid_t rid, ipc_call_t *request)
-{
-	libfs_stat(&ext2_libfs_ops, ext2_reg.fs_handle, rid, request);
-}
-
-void ext2_sync(ipc_callid_t rid, ipc_call_t *request)
-{
-//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
-//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
-	
-	// TODO
-	async_answer_0(rid, ENOTSUP);
-}
-
-/**
- * @}
- */
Index: uspace/srv/fs/ext2fs/Makefile
===================================================================
--- uspace/srv/fs/ext2fs/Makefile	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
+++ uspace/srv/fs/ext2fs/Makefile	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 Jakub Jermar
+# Copyright (c) 2010 Martin Sucha
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../../..
+LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBFS_PREFIX)/libfs.a $(LIBEXT2_PREFIX)/libext2.a
+EXTRA_CFLAGS += -I$(LIBBLOCK_PREFIX) -I$(LIBFS_PREFIX) -I$(LIBEXT2_PREFIX)
+BINARY = ext2fs
+
+SOURCES = \
+	ext2fs.c \
+	ext2fs_ops.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/fs/ext2fs/ext2fs.c
===================================================================
--- uspace/srv/fs/ext2fs/ext2fs.c	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
+++ uspace/srv/fs/ext2fs/ext2fs.c	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2006 Martin Decky
+ * Copyright (c) 2008 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup fs
+ * @{
+ */ 
+
+/**
+ * @file	ext2.c
+ * @brief	EXT2 file system driver for HelenOS.
+ */
+
+#include "ext2fs.h"
+#include <ipc/services.h>
+#include <ipc/ns.h>
+#include <async.h>
+#include <errno.h>
+#include <unistd.h>
+#include <task.h>
+#include <stdio.h>
+#include <libfs.h>
+#include "../../vfs/vfs.h"
+
+#define NAME	"ext2fs"
+
+vfs_info_t ext2fs\_vfs_info = {
+	.name = NAME,
+};
+
+fs_reg_t ext2fs_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 EXT2FS. To overcome this bottleneck, VFS can send EXT2FS 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, EXT2FS 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, EXT2FS might want to keep the connections open after the
+ * request has been completed.
+ */
+static void ext2_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:
+			ext2fs_mounted(callid, &call);
+			break;
+		case VFS_OUT_MOUNT:
+			ext2fs_mount(callid, &call);
+			break;
+		case VFS_OUT_UNMOUNTED:
+			ext2fs_unmounted(callid, &call);
+			break;
+		case VFS_OUT_UNMOUNT:
+			ext2fs_unmount(callid, &call);
+			break;
+		case VFS_OUT_LOOKUP:
+			ext2fs_lookup(callid, &call);
+			break;
+		case VFS_OUT_READ:
+			ext2fs_read(callid, &call);
+			break;
+		case VFS_OUT_WRITE:
+			ext2fs_write(callid, &call);
+			break;
+		case VFS_OUT_TRUNCATE:
+			ext2fs_truncate(callid, &call);
+			break;
+		case VFS_OUT_STAT:
+			ext2fs_stat(callid, &call);
+			break;
+		case VFS_OUT_CLOSE:
+			ext2fs_close(callid, &call);
+			break;
+		case VFS_OUT_DESTROY:
+			ext2fs_destroy(callid, &call);
+			break;
+		case VFS_OUT_OPEN_NODE:
+			ext2fs_open_node(callid, &call);
+			break;
+		case VFS_OUT_SYNC:
+			ext2fs_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 EXT2 file system server\n");
+
+	vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
+	if (vfs_phone < EOK) {
+		printf(NAME ": failed to connect to VFS\n");
+		return -1;
+	}
+	
+	rc = fs_register(vfs_phone, &ext2fs_reg, &ext2fs_vfs_info, ext2_connection);
+	
+	printf(NAME ": Accepting connections\n");
+	task_retval(0);
+	async_manager();
+	/* not reached */
+	return 0;
+}
+
+/**
+ * @}
+ */ 
Index: uspace/srv/fs/ext2fs/ext2fs.h
===================================================================
--- uspace/srv/fs/ext2fs/ext2fs.h	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
+++ uspace/srv/fs/ext2fs/ext2fs.h	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2008 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup fs
+ * @{
+ */ 
+
+#ifndef EXT2FS_EXT2FS_H_
+#define EXT2FS_EXT2FS_H_
+
+#include <libext2.h>
+#include <fibril_synch.h>
+#include <libfs.h>
+#include <atomic.h>
+#include <sys/types.h>
+#include <bool.h>
+#include "../../vfs/vfs.h"
+
+#ifndef dprintf
+#define dprintf(...)	printf(__VA_ARGS__)
+#endif
+
+#define min(a, b)		((a) < (b) ? (a) : (b))
+
+extern fs_reg_t ext2fs_reg;
+
+extern int ext2fs_global_init(void);
+extern void ext2fs_mounted(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_mount(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_unmounted(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_unmount(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_lookup(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_read(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_write(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_truncate(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_stat(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_close(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_destroy(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_open_node(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_stat(ipc_callid_t, ipc_call_t *);
+extern void ext2fs_sync(ipc_callid_t, ipc_call_t *);
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/srv/fs/ext2fs/ext2fs_ops.c
===================================================================
--- uspace/srv/fs/ext2fs/ext2fs_ops.c	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
+++ uspace/srv/fs/ext2fs/ext2fs_ops.c	(revision 796c2769cccc3e21b54726888aa0cb7a3c238e40)
@@ -0,0 +1,387 @@
+/*
+ * Copyright (c) 2008 Jakub Jermar
+ * Copyright (c) 2011 Martin Sucha
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup fs
+ * @{
+ */ 
+
+/**
+ * @file	ext2fs_ops.c
+ * @brief	Implementation of VFS operations for the EXT2 file system server.
+ */
+
+#include "ext2fs.h"
+#include "../../vfs/vfs.h"
+#include <libfs.h>
+#include <libblock.h>
+#include <libext2.h>
+#include <ipc/services.h>
+#include <ipc/devmap.h>
+#include <macros.h>
+#include <async.h>
+#include <errno.h>
+#include <str.h>
+#include <byteorder.h>
+#include <adt/hash_table.h>
+#include <adt/list.h>
+#include <assert.h>
+#include <fibril_synch.h>
+#include <sys/mman.h>
+#include <align.h>
+#include <adt/hash_table.h>
+
+#define EXT2_NODE(node)	((node) ? (ext2fs_node_t *) (node)->data : NULL)
+#define FS_NODE(node)	((node) ? (node)->bp : NULL)
+
+#define FS_BUCKETS_LOG	12
+#define FS_BUCKETS	(1 << FS_BUCKETS_LOG)
+
+/*
+ * Forward declarations of EXT2 libfs operations.
+ */
+static int ext2fs_root_get(fs_node_t **, devmap_handle_t);
+static int ext2fs_match(fs_node_t **, fs_node_t *, const char *);
+static int ext2fs_node_get(fs_node_t **, devmap_handle_t, fs_index_t);
+static int ext2fs_node_open(fs_node_t *);
+static int ext2fs_node_put(fs_node_t *);
+static int ext2fs_create_node(fs_node_t **, devmap_handle_t, int);
+static int ext2fs_destroy_node(fs_node_t *);
+static int ext2fs_link(fs_node_t *, fs_node_t *, const char *);
+static int ext2fs_unlink(fs_node_t *, fs_node_t *, const char *);
+static int ext2fs_has_children(bool *, fs_node_t *);
+static fs_index_t ext2fs_index_get(fs_node_t *);
+static aoff64_t ext2fs_size_get(fs_node_t *);
+static unsigned ext2fs_lnkcnt_get(fs_node_t *);
+static char ext2fs_plb_get_char(unsigned);
+static bool ext2fs_is_directory(fs_node_t *);
+static bool ext2fs_is_file(fs_node_t *node);
+static devmap_handle_t ext2fs_device_get(fs_node_t *node);
+
+/*
+ * Static variables
+ */
+
+/**
+ * Global hash table holding a mapping from devmap handles to
+ * ext2_filesystem_t structures
+ */
+//TODO
+//static hash_table_t fs_hash;
+
+/**
+ * Mutex protecting fs_hash
+ */
+static FIBRIL_MUTEX_INITIALIZE(fs_hash_lock);
+
+/**
+ * 
+ */
+int ext2fs_global_init(void)
+{
+	//TODO
+	//if (!hash_table_create(&fs_hash, FS_BUCKETS, 1, &fs_hash_ops)) {
+	//	return ENOMEM;
+	//}
+	
+	return EOK;
+}
+
+
+
+/*
+ * EXT2 libfs operations.
+ */
+
+int ext2fs_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
+{
+	// TODO
+	return 0;
+	//return ext2fs_node_get(rfn, devmap_handle, 0);
+}
+
+int ext2fs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+/** Instantiate a EXT2 in-core node. */
+int ext2fs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_node_open(fs_node_t *fn)
+{
+	/*
+	 * Opening a file is stateless, nothing
+	 * to be done here.
+	 */
+	return EOK;
+}
+
+int ext2fs_node_put(fs_node_t *fn)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_destroy_node(fs_node_t *fn)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+int ext2fs_has_children(bool *has_children, fs_node_t *fn)
+{
+	// TODO
+	return ENOTSUP;
+}
+
+
+fs_index_t ext2fs_index_get(fs_node_t *fn)
+{
+	// TODO
+	return 0;
+}
+
+aoff64_t ext2fs_size_get(fs_node_t *fn)
+{
+	// TODO
+	return 0;
+}
+
+unsigned ext2fs_lnkcnt_get(fs_node_t *fn)
+{
+	// TODO
+	return 0;
+}
+
+char ext2fs_plb_get_char(unsigned pos)
+{
+	return ext2fs_reg.plb_ro[pos % PLB_SIZE];
+}
+
+bool ext2fs_is_directory(fs_node_t *fn)
+{
+	// TODO
+	return false;
+}
+
+bool ext2fs_is_file(fs_node_t *fn)
+{
+	// TODO
+	return false;
+}
+
+devmap_handle_t ext2fs_device_get(fs_node_t *node)
+{
+	return 0;
+}
+
+/** libfs operations */
+libfs_ops_t ext2fs_libfs_ops = {
+	.root_get = ext2fs_root_get,
+	.match = ext2fs_match,
+	.node_get = ext2fs_node_get,
+	.node_open = ext2fs_node_open,
+	.node_put = ext2fs_node_put,
+	.create = ext2fs_create_node,
+	.destroy = ext2fs_destroy_node,
+	.link = ext2fs_link,
+	.unlink = ext2fs_unlink,
+	.has_children = ext2fs_has_children,
+	.index_get = ext2fs_index_get,
+	.size_get = ext2fs_size_get,
+	.lnkcnt_get = ext2fs_lnkcnt_get,
+	.plb_get_char = ext2fs_plb_get_char,
+	.is_directory = ext2fs_is_directory,
+	.is_file = ext2fs_is_file,
+	.device_get = ext2fs_device_get
+};
+
+/*
+ * VFS operations.
+ */
+
+void ext2fs_mounted(ipc_callid_t rid, ipc_call_t *request)
+{
+	int rc;
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+	ext2_filesystem_t *fs;
+	
+	/* Accept the mount options */
+	char *opts;
+	rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
+	
+	if (rc != EOK) {
+		async_answer_0(rid, rc);
+		return;
+	}
+
+	free(opts);
+	
+	/* Allocate libext2 filesystem structure */
+	fs = (ext2_filesystem_t *) malloc(sizeof(ext2_filesystem_t));
+	if (fs == NULL) {
+		async_answer_0(rid, ENOMEM);
+		return;
+	}
+	
+	/* Initialize the filesystem  */
+	rc = ext2_filesystem_init(fs, devmap_handle);
+	if (rc != EOK) {
+		async_answer_0(rid, rc);
+		return;
+	}
+	
+	/* Do some sanity checking */
+	rc = ext2_filesystem_check_sanity(fs);
+	if (rc != EOK) {
+		ext2_filesystem_fini(fs);
+		async_answer_0(rid, rc);
+		return;
+	}
+	
+	
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_mount(ipc_callid_t rid, ipc_call_t *request)
+{
+	libfs_mount(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
+}
+
+void ext2fs_unmounted(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_unmount(ipc_callid_t rid, ipc_call_t *request)
+{
+	libfs_unmount(&ext2fs_libfs_ops, rid, request);
+}
+
+void ext2fs_lookup(ipc_callid_t rid, ipc_call_t *request)
+{
+	libfs_lookup(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
+}
+
+void ext2fs_read(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
+//	aoff64_t pos =
+//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_write(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
+//	aoff64_t pos =
+//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_truncate(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
+//	aoff64_t size =
+//	    (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_close(ipc_callid_t rid, ipc_call_t *request)
+{
+	async_answer_0(rid, EOK);
+}
+
+void ext2fs_destroy(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
+//	fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+void ext2fs_open_node(ipc_callid_t rid, ipc_call_t *request)
+{
+	libfs_open_node(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
+}
+
+void ext2fs_stat(ipc_callid_t rid, ipc_call_t *request)
+{
+	libfs_stat(&ext2fs_libfs_ops, ext2fs_reg.fs_handle, rid, request);
+}
+
+void ext2fs_sync(ipc_callid_t rid, ipc_call_t *request)
+{
+//	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+//	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
+	
+	// TODO
+	async_answer_0(rid, ENOTSUP);
+}
+
+/**
+ * @}
+ */
