Index: uspace/srv/fs/tmpfs/tmpfs.h
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.h	(revision 8d049ee047c5d57ada58879485512cc55e55e918)
+++ uspace/srv/fs/tmpfs/tmpfs.h	(revision 0be3e8beefa6bc22baebe98fe92dd97f1c2df2b7)
@@ -45,4 +45,7 @@
 #endif
 
+#define TMPFS_NODE(node)	((node) ? (tmpfs_dentry_t *)(node)->data : NULL)
+#define FS_NODE(node)		((node) ? (node)->bp : NULL)
+
 typedef enum {
 	TMPFS_NONE,
@@ -52,4 +55,5 @@
 
 typedef struct tmpfs_dentry {
+	fs_node_t *bp;		/**< Back pointer to the FS node. */
 	fs_index_t index;	/**< TMPFS node index. */
 	dev_handle_t dev_handle;/**< Device handle. */
Index: uspace/srv/fs/tmpfs/tmpfs_dump.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_dump.c	(revision 8d049ee047c5d57ada58879485512cc55e55e918)
+++ uspace/srv/fs/tmpfs/tmpfs_dump.c	(revision 0be3e8beefa6bc22baebe98fe92dd97f1c2df2b7)
@@ -56,5 +56,5 @@
 static bool
 tmpfs_restore_recursion(int dev, off_t *bufpos, size_t *buflen, off_t *pos,
-    tmpfs_dentry_t *parent)
+    fs_node_t *pfn)
 {
 	struct rdentry entry;
@@ -64,5 +64,6 @@
 	do {
 		char *fname;
-		tmpfs_dentry_t *node;
+		fs_node_t *fn;
+		tmpfs_dentry_t *nodep;
 		uint32_t size;
 		
@@ -81,6 +82,6 @@
 				return false;
 			
-			node = (tmpfs_dentry_t *) ops->create(dev, L_FILE);
-			if (node == NULL) {
+			fn = ops->create(dev, L_FILE);
+			if (fn == NULL) {
 				free(fname);
 				return false;
@@ -89,5 +90,5 @@
 			if (block_read(dev, bufpos, buflen, pos, fname,
 			    entry.len, TMPFS_BLOCK_SIZE) != EOK) {
-				ops->destroy((void *) node);
+				ops->destroy(fn);
 				free(fname);
 				return false;
@@ -95,7 +96,7 @@
 			fname[entry.len] = 0;
 			
-			rc = ops->link((void *) parent, (void *) node, fname);
+			rc = ops->link(pfn, fn, fname);
 			if (rc != EOK) {
-				ops->destroy((void *) node);
+				ops->destroy(fn);
 				free(fname);
 				return false;
@@ -109,10 +110,11 @@
 			size = uint32_t_le2host(size);
 			
-			node->data = malloc(size);
-			if (node->data == NULL)
+			nodep = TMPFS_NODE(fn);
+			nodep->data = malloc(size);
+			if (nodep->data == NULL)
 				return false;
 			
-			node->size = size;
-			if (block_read(dev, bufpos, buflen, pos, node->data,
+			nodep->size = size;
+			if (block_read(dev, bufpos, buflen, pos, nodep->data,
 			    size, TMPFS_BLOCK_SIZE) != EOK)
 				return false;
@@ -124,6 +126,6 @@
 				return false;
 			
-			node = (tmpfs_dentry_t *) ops->create(dev, L_DIRECTORY);
-			if (node == NULL) {
+			fn = ops->create(dev, L_DIRECTORY);
+			if (fn == NULL) {
 				free(fname);
 				return false;
@@ -132,5 +134,5 @@
 			if (block_read(dev, bufpos, buflen, pos, fname,
 			    entry.len, TMPFS_BLOCK_SIZE) != EOK) {
-				ops->destroy((void *) node);
+				ops->destroy(fn);
 				free(fname);
 				return false;
@@ -138,7 +140,7 @@
 			fname[entry.len] = 0;
 
-			rc = ops->link((void *) parent, (void *) node, fname);
+			rc = ops->link(pfn, fn, fname);
 			if (rc != EOK) {
-				ops->destroy((void *) node);
+				ops->destroy(fn);
 				free(fname);
 				return false;
@@ -147,5 +149,5 @@
 			
 			if (!tmpfs_restore_recursion(dev, bufpos, buflen, pos,
-			    node))
+			    fn))
 				return false;
 			
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 8d049ee047c5d57ada58879485512cc55e55e918)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 0be3e8beefa6bc22baebe98fe92dd97f1c2df2b7)
@@ -69,34 +69,34 @@
 
 /* Forward declarations of static functions. */
-static void *tmpfs_match(void *, const char *);
-static void *tmpfs_node_get(dev_handle_t, fs_index_t);
-static void tmpfs_node_put(void *);
-static void *tmpfs_create_node(dev_handle_t, int);
-static int tmpfs_link_node(void *, void *, const char *);
-static int tmpfs_unlink_node(void *, void *);
-static int tmpfs_destroy_node(void *);
+static fs_node_t *tmpfs_match(fs_node_t *, const char *);
+static fs_node_t *tmpfs_node_get(dev_handle_t, fs_index_t);
+static void tmpfs_node_put(fs_node_t *);
+static fs_node_t *tmpfs_create_node(dev_handle_t, int);
+static int tmpfs_link_node(fs_node_t *, fs_node_t *, const char *);
+static int tmpfs_unlink_node(fs_node_t *, fs_node_t *);
+static int tmpfs_destroy_node(fs_node_t *);
 
 /* Implementation of helper functions. */
-static fs_index_t tmpfs_index_get(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->index;
-}
-
-static size_t tmpfs_size_get(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->size;
-}
-
-static unsigned tmpfs_lnkcnt_get(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->lnkcnt;
-}
-
-static bool tmpfs_has_children(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->child != NULL;
-}
-
-static void *tmpfs_root_get(dev_handle_t dev_handle)
+static fs_index_t tmpfs_index_get(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->index;
+}
+
+static size_t tmpfs_size_get(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->size;
+}
+
+static unsigned tmpfs_lnkcnt_get(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->lnkcnt;
+}
+
+static bool tmpfs_has_children(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->child != NULL;
+}
+
+static fs_node_t *tmpfs_root_get(dev_handle_t dev_handle)
 {
 	return tmpfs_node_get(dev_handle, TMPFS_SOME_ROOT); 
@@ -108,12 +108,12 @@
 }
 
-static bool tmpfs_is_directory(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->type == TMPFS_DIRECTORY;
-}
-
-static bool tmpfs_is_file(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->type == TMPFS_FILE;
+static bool tmpfs_is_directory(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->type == TMPFS_DIRECTORY;
+}
+
+static bool tmpfs_is_file(fs_node_t *fn)
+{
+	return TMPFS_NODE(fn)->type == TMPFS_FILE;
 }
 
@@ -214,4 +214,5 @@
 static bool tmpfs_dentry_initialize(tmpfs_dentry_t *dentry)
 {
+	dentry->bp = NULL;
 	dentry->index = 0;
 	dentry->dev_handle = 0;
@@ -237,10 +238,10 @@
 static bool tmpfs_instance_init(dev_handle_t dev_handle)
 {
-	tmpfs_dentry_t *root;
+	fs_node_t *rfn;
 	
-	root = (tmpfs_dentry_t *) tmpfs_create_node(dev_handle, L_DIRECTORY);
-	if (!root) 
+	rfn = tmpfs_create_node(dev_handle, L_DIRECTORY);
+	if (!rfn) 
 		return false;
-	root->lnkcnt = 0;	/* FS root is not linked */
+	TMPFS_NODE(rfn)->lnkcnt = 0;	/* FS root is not linked */
 	return true;
 }
@@ -265,7 +266,7 @@
 }
 
-void *tmpfs_match(void *prnt, const char *component)
-{
-	tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt;
+fs_node_t *tmpfs_match(fs_node_t *pfn, const char *component)
+{
+	tmpfs_dentry_t *parentp = TMPFS_NODE(pfn);
 	tmpfs_dentry_t *childp = parentp->child;
 
@@ -273,9 +274,8 @@
 		childp = childp->sibling;
 
-	return (void *) childp;
-}
-
-void *
-tmpfs_node_get(dev_handle_t dev_handle, fs_index_t index)
+	return FS_NODE(childp);
+}
+
+fs_node_t *tmpfs_node_get(dev_handle_t dev_handle, fs_index_t index)
 {
 	unsigned long key[] = {
@@ -286,24 +286,32 @@
 	if (!lnk)
 		return NULL;
-	return hash_table_get_instance(lnk, tmpfs_dentry_t, dh_link); 
-}
-
-void tmpfs_node_put(void *node)
+	return FS_NODE(hash_table_get_instance(lnk, tmpfs_dentry_t, dh_link));
+}
+
+void tmpfs_node_put(fs_node_t *fn)
 {
 	/* nothing to do */
 }
 
-void *tmpfs_create_node(dev_handle_t dev_handle, int lflag)
+fs_node_t *tmpfs_create_node(dev_handle_t dev_handle, int lflag)
 {
 	assert((lflag & L_FILE) ^ (lflag & L_DIRECTORY));
 
+	fs_node_t *fn = malloc(sizeof(fs_node_t));
+	if (!fn)
+		return NULL;
+	
 	tmpfs_dentry_t *node = malloc(sizeof(tmpfs_dentry_t));
-	if (!node)
+	if (!node) {
+		free(fn);
 		return NULL;
-
+	}
 	if (!tmpfs_dentry_initialize(node)) {
+		free(fn);
 		free(node);
 		return NULL;
 	}
+	fn->data = node;
+	node->bp = fn;	/* establish the back pointer */
 	if (!tmpfs_root_get(dev_handle))
 		node->index = TMPFS_SOME_ROOT;
@@ -322,11 +330,11 @@
 	};
 	hash_table_insert(&dentries, key, &node->dh_link);
-	return (void *) node;
-}
-
-int tmpfs_link_node(void *prnt, void *chld, const char *nm)
-{
-	tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt;
-	tmpfs_dentry_t *childp = (tmpfs_dentry_t *) chld;
+	return fn;
+}
+
+int tmpfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm)
+{
+	tmpfs_dentry_t *parentp = TMPFS_NODE(pfn);
+	tmpfs_dentry_t *childp = TMPFS_NODE(cfn);
 
 	assert(parentp->type == TMPFS_DIRECTORY);
@@ -363,8 +371,8 @@
 }
 
-int tmpfs_unlink_node(void *prnt, void *chld)
-{
-	tmpfs_dentry_t *parentp = (tmpfs_dentry_t *)prnt;
-	tmpfs_dentry_t *childp = (tmpfs_dentry_t *)chld;
+int tmpfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn)
+{
+	tmpfs_dentry_t *parentp = TMPFS_NODE(pfn);
+	tmpfs_dentry_t *childp = TMPFS_NODE(cfn);
 
 	if (!parentp)
@@ -393,7 +401,7 @@
 }
 
-int tmpfs_destroy_node(void *nodep)
-{
-	tmpfs_dentry_t *dentry = (tmpfs_dentry_t *) nodep;
+int tmpfs_destroy_node(fs_node_t *fn)
+{
+	tmpfs_dentry_t *dentry = TMPFS_NODE(fn);
 	
 	assert(!dentry->lnkcnt);
@@ -411,4 +419,5 @@
 	if (dentry->type == TMPFS_FILE)
 		free(dentry->data);
+	free(dentry->bp);
 	free(dentry);
 	return EOK;
@@ -447,5 +456,5 @@
 	}
 
-	tmpfs_dentry_t *root = tmpfs_root_get(dev_handle);
+	tmpfs_dentry_t *root = TMPFS_NODE(tmpfs_root_get(dev_handle));
 	if (str_cmp(opts, "restore") == 0) {
 		if (tmpfs_restore(dev_handle))
@@ -673,5 +682,5 @@
 	tmpfs_dentry_t *dentry = hash_table_get_instance(hlp, tmpfs_dentry_t,
 	    dh_link);
-	rc = tmpfs_destroy_node(dentry);
+	rc = tmpfs_destroy_node(FS_NODE(dentry));
 	ipc_answer_0(rid, rc);
 }
