Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision e056e820b9db35da00248703afade858979310b5)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 3c11713f9fe58a2b3a19f2e9e4bfc0f709a63c2e)
@@ -147,6 +147,6 @@
 hash_table_t nodes;
 
-#define NODES_KEY_DEV	0	
-#define NODES_KEY_INDEX	1
+#define NODES_KEY_INDEX	0
+#define NODES_KEY_DEV	1
 
 /* Implementation of hash table interface for the nodes hash table. */
@@ -166,22 +166,4 @@
 static void nodes_remove_callback(link_t *item)
 {
-	tmpfs_node_t *nodep = hash_table_get_instance(item, tmpfs_node_t,
-	    nh_link);
-
-	while (!list_empty(&nodep->cs_head)) {
-		tmpfs_dentry_t *dentryp = list_get_instance(nodep->cs_head.next,
-		    tmpfs_dentry_t, link);
-
-		assert(nodep->type == TMPFS_DIRECTORY);
-		list_remove(&dentryp->link);
-		free(dentryp);
-	}
-
-	if (nodep->data) {
-		assert(nodep->type == TMPFS_FILE);
-		free(nodep->data);
-	}
-	free(nodep->bp);
-	free(nodep);
 }
 
@@ -233,19 +215,4 @@
 }
 
-static void tmpfs_instance_done(dev_handle_t dev_handle)
-{
-	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle
-	};
-	/*
-	 * Here we are making use of one special feature of our hash table
-	 * implementation, which allows to remove more items based on a partial
-	 * key match. In the following, we are going to remove all nodes
-	 * matching our device handle. The nodes_remove_callback() function will
-	 * take care of resource deallocation.
-	 */
-	hash_table_remove(&nodes, key, 1);
-}
-
 int tmpfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
 {
@@ -270,6 +237,6 @@
 {
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
-		[NODES_KEY_INDEX] = index
+		[NODES_KEY_INDEX] = index,
+		[NODES_KEY_DEV] = dev_handle
 	};
 	link_t *lnk = hash_table_find(&nodes, key);
@@ -329,6 +296,6 @@
 	/* Insert the new node into the nodes hash table. */
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = nodep->dev_handle,
-		[NODES_KEY_INDEX] = nodep->index
+		[NODES_KEY_INDEX] = nodep->index,
+		[NODES_KEY_DEV] = nodep->dev_handle
 	};
 	hash_table_insert(&nodes, key, &nodep->nh_link);
@@ -345,13 +312,13 @@
 
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = nodep->dev_handle,
-		[NODES_KEY_INDEX] = nodep->index
+		[NODES_KEY_INDEX] = nodep->index,
+		[NODES_KEY_DEV] = nodep->dev_handle
 	};
 	hash_table_remove(&nodes, key, 2);
 
-	/*
-	 * The nodes_remove_callback() function takes care of the actual
-	 * resource deallocation.
-	 */
+	if (nodep->type == TMPFS_FILE)
+		free(nodep->data);
+	free(nodep->bp);
+	free(nodep);
 	return EOK;
 }
@@ -457,5 +424,4 @@
 	/* Initialize TMPFS instance. */
 	if (!tmpfs_instance_init(dev_handle)) {
-		free(opts);
 		ipc_answer_0(rid, ENOMEM);
 		return;
@@ -476,5 +442,4 @@
 		    rootp->lnkcnt);
 	}
-	free(opts);
 }
 
@@ -486,8 +451,5 @@
 void tmpfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
-
-	tmpfs_instance_done(dev_handle);
-	ipc_answer_0(rid, EOK);
+	ipc_answer_0(rid, ENOTSUP);
 }
 
@@ -513,6 +475,6 @@
 	link_t *hlp;
 	unsigned long key[] = {
+		[NODES_KEY_INDEX] = index,
 		[NODES_KEY_DEV] = dev_handle,
-		[NODES_KEY_INDEX] = index
 	};
 	hlp = hash_table_find(&nodes, key);
@@ -587,6 +549,6 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
-		[NODES_KEY_INDEX] = index
+		[NODES_KEY_INDEX] = index,
+		[NODES_KEY_DEV] = dev_handle
 	};
 	hlp = hash_table_find(&nodes, key);
@@ -651,6 +613,6 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
-		[NODES_KEY_INDEX] = index
+		[NODES_KEY_INDEX] = index,
+		[NODES_KEY_DEV] = dev_handle
 	};
 	hlp = hash_table_find(&nodes, key);
@@ -694,6 +656,6 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
-		[NODES_KEY_INDEX] = index
+		[NODES_KEY_INDEX] = index,
+		[NODES_KEY_DEV] = dev_handle
 	};
 	hlp = hash_table_find(&nodes, key);
