Index: uspace/lib/libc/generic/adt/hash_table.c
===================================================================
--- uspace/lib/libc/generic/adt/hash_table.c	(revision 3698e4420e4bdd79a3251c212fbc1886ecf45436)
+++ uspace/lib/libc/generic/adt/hash_table.c	(revision b79d450c48dd4e1488486327295df7c5c51e93b7)
@@ -193,4 +193,24 @@
 }
 
+/** Apply fucntion to all items in hash table.
+ *
+ * @param h		Hash table.
+ * @param f		Function to be applied.
+ * @param arg		Argument to be passed to the function.
+ */
+void
+hash_table_apply(hash_table_t *h, void (*f)(link_t *, void *), void *arg)
+{
+	hash_index_t bucket;
+	link_t *cur;
+
+	for (bucket = 0; bucket < h->entries; bucket++) {
+		for (cur = h->entry[bucket].next; cur != &h->entry[bucket];
+		    cur = cur->next) {
+			f(cur, arg);
+		}
+	}
+}
+
 /** @}
  */
Index: uspace/lib/libc/generic/vfs/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs/vfs.c	(revision 3698e4420e4bdd79a3251c212fbc1886ecf45436)
+++ uspace/lib/libc/generic/vfs/vfs.c	(revision b79d450c48dd4e1488486327295df7c5c51e93b7)
@@ -197,4 +197,42 @@
 }
 
+int unmount(const char *mp)
+{
+	ipcarg_t rc;
+	ipcarg_t rc_orig;
+	aid_t req;
+	size_t mpa_size;
+	char *mpa;
+	
+	mpa = absolutize(mp, &mpa_size);
+	if (!mpa)
+		return ENOMEM;
+	
+	futex_down(&vfs_phone_futex);
+	async_serialize_start();
+	vfs_connect();
+	
+	req = async_send_0(vfs_phone, VFS_IN_UNMOUNT, NULL);
+	rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
+	if (rc != EOK) {
+		async_wait_for(req, &rc_orig);
+		async_serialize_end();
+		futex_up(&vfs_phone_futex);
+		free(mpa);
+		if (rc_orig == EOK)
+			return (int) rc;
+		else
+			return (int) rc_orig;
+	}
+	
+
+	async_wait_for(req, &rc);
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+	free(mpa);
+	
+	return (int) rc;
+}
+
 static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag)
 {
Index: uspace/lib/libc/include/adt/hash_table.h
===================================================================
--- uspace/lib/libc/include/adt/hash_table.h	(revision 3698e4420e4bdd79a3251c212fbc1886ecf45436)
+++ uspace/lib/libc/include/adt/hash_table.h	(revision b79d450c48dd4e1488486327295df7c5c51e93b7)
@@ -88,4 +88,6 @@
 extern void hash_table_remove(hash_table_t *, unsigned long [], hash_count_t);
 extern void hash_table_destroy(hash_table_t *);
+extern void hash_table_apply(hash_table_t *, void (*)(link_t *, void *),
+    void *);
 
 #endif
Index: uspace/lib/libc/include/ipc/vfs.h
===================================================================
--- uspace/lib/libc/include/ipc/vfs.h	(revision 3698e4420e4bdd79a3251c212fbc1886ecf45436)
+++ uspace/lib/libc/include/ipc/vfs.h	(revision b79d450c48dd4e1488486327295df7c5c51e93b7)
@@ -86,4 +86,5 @@
 	VFS_OUT_MOUNTED,
 	VFS_OUT_UNMOUNT,
+	VFS_OUT_UNMOUNTED,
 	VFS_OUT_SYNC,
 	VFS_OUT_STAT,
@@ -100,5 +101,5 @@
  * No lookup flags used.
  */
-#define L_NONE  0
+#define L_NONE			0
 
 /**
@@ -107,12 +108,25 @@
  * with L_DIRECTORY.
  */
-#define L_FILE  1
+#define L_FILE			1
 
 /**
- * Lookup wil succeed only if the object is a directory. If L_CREATE is
+ * Lookup will succeed only if the object is a directory. If L_CREATE is
  * specified, an empty directory will be created. This flag is mutually
  * exclusive with L_FILE.
  */
-#define L_DIRECTORY  2
+#define L_DIRECTORY		2
+
+/**
+ * Lookup will succeed only if the object is a root directory. The flag is
+ * mutually exclusive with L_FILE and L_MP.
+ */
+#define L_ROOT			4
+
+/**
+ * Lookup will succeed only if the object is a mount point. The flag is mutually
+ * exclusive with L_FILE and L_ROOT.
+ */
+#define L_MP			8
+
 
 /**
@@ -120,15 +134,15 @@
  * object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used.
  */
-#define L_EXCLUSIVE  4
+#define L_EXCLUSIVE 		16
 
 /**
  * L_CREATE is used for creating both regular files and directories.
  */
-#define L_CREATE  8
+#define L_CREATE		32
 
 /**
  * L_LINK is used for linking to an already existing nodes.
  */
-#define L_LINK  16
+#define L_LINK			64
 
 /**
@@ -137,13 +151,13 @@
  * VFS_UNLINK.
  */
-#define L_UNLINK  32
+#define L_UNLINK		128
 
 /**
- * L_OPEN is used to indicate that the lookup operation is a part of VFS_OPEN
+ * L_OPEN is used to indicate that the lookup operation is a part of VFS_IN_OPEN
  * call from the client. This means that the server might allocate some
  * resources for the opened file. This flag cannot be passed directly by the
  * client.
  */
-#define L_OPEN  64
+#define L_OPEN			256
 
 #endif
Index: uspace/lib/libc/include/vfs/vfs.h
===================================================================
--- uspace/lib/libc/include/vfs/vfs.h	(revision 3698e4420e4bdd79a3251c212fbc1886ecf45436)
+++ uspace/lib/libc/include/vfs/vfs.h	(revision b79d450c48dd4e1488486327295df7c5c51e93b7)
@@ -55,4 +55,5 @@
 extern int mount(const char *, const char *, const char *, const char *,
     unsigned int);
+extern int unmount(const char *);
 
 extern void __stdio_init(int filc, fdi_node_t *filv[]);
