Index: uspace/lib/libfs/libfs.c
===================================================================
--- uspace/lib/libfs/libfs.c	(revision 5e790e6b939aa607577c7afa587fffe15763b421)
+++ uspace/lib/libfs/libfs.c	(revision 736c164f56cd1cac7084f1032aaca53396bc3c3f)
@@ -149,5 +149,5 @@
 	void *par = NULL;
 	void *cur = ops->root_get();
-	void *tmp = ops->child_get(cur);
+	void *tmp;
 
 	if (ops->plb_get_char(next) == '/')
@@ -156,5 +156,5 @@
 	char component[NAME_MAX + 1];
 	int len = 0;
-	while (tmp && next <= last) {
+	while (ops->has_children(cur) && next <= last) {
 
 		/* collect the component */
@@ -177,6 +177,5 @@
 
 		/* match the component */
-		while (tmp && !ops->match(cur, tmp, component))
-			tmp = ops->sibling_get(tmp);
+		tmp = ops->match(cur, component);
 
 		/* handle miss: match amongst siblings */
@@ -229,9 +228,8 @@
 		par = cur;
 		cur = tmp;
-		tmp = ops->child_get(tmp);
 	}
 
 	/* handle miss: excessive components */
-	if (!tmp && next <= last) {
+	if (!ops->has_children(cur) && next <= last) {
 		if (lflag & (L_CREATE | L_LINK)) {
 			if (!ops->is_directory(cur)) {
Index: uspace/lib/libfs/libfs.h
===================================================================
--- uspace/lib/libfs/libfs.h	(revision 5e790e6b939aa607577c7afa587fffe15763b421)
+++ uspace/lib/libfs/libfs.h	(revision 736c164f56cd1cac7084f1032aaca53396bc3c3f)
@@ -43,5 +43,5 @@
 
 typedef struct {
-	bool (* match)(void *, void *, const char *);
+	void * (* match)(void *, const char *);
 	void * (* node_get)(fs_handle_t, dev_handle_t, fs_index_t);
 	void * (* create)(int);
@@ -52,6 +52,5 @@
 	size_t (* size_get)(void *);
 	unsigned (* lnkcnt_get)(void *);
-	void *(* child_get)(void *);
-	void *(* sibling_get)(void *);
+	bool (* has_children)(void *);
 	void *(* root_get)(void);
 	char (* plb_get_char)(unsigned pos);	
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 5e790e6b939aa607577c7afa587fffe15763b421)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 736c164f56cd1cac7084f1032aaca53396bc3c3f)
@@ -70,5 +70,5 @@
 
 /* Forward declarations of static functions. */
-static bool tmpfs_match(void *, void *, const char *);
+static void *tmpfs_match(void *, const char *);
 static void *tmpfs_node_get(fs_handle_t, dev_handle_t, fs_index_t);
 static void *tmpfs_create_node(int);
@@ -93,12 +93,7 @@
 }
 
-static void *tmpfs_child_get(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->child;
-}
-
-static void *tmpfs_sibling_get(void *nodep)
-{
-	return ((tmpfs_dentry_t *) nodep)->sibling;
+static bool tmpfs_has_children(void *nodep)
+{
+	return ((tmpfs_dentry_t *) nodep)->child != NULL;
 }
 
@@ -134,6 +129,5 @@
 	.size_get = tmpfs_size_get,
 	.lnkcnt_get = tmpfs_lnkcnt_get,
-	.child_get = tmpfs_child_get,
-	.sibling_get = tmpfs_sibling_get,
+	.has_children = tmpfs_has_children,
 	.root_get = tmpfs_root_get,
 	.plb_get_char = tmpfs_plb_get_char,
@@ -244,21 +238,30 @@
 /** Compare one component of path to a directory entry.
  *
- * @param prnt		Node from which we descended.
- * @param chld		Node to compare the path component with.
+ * @param parentp	Pointer to node from which we descended.
+ * @param childp	Pointer to node to compare the path component with.
  * @param component	Array of characters holding component name.
  *
  * @return		True on match, false otherwise.
  */
-bool tmpfs_match(void *prnt, void *chld, const char *component)
-{
-	tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt;
-	tmpfs_dentry_t *childp = (tmpfs_dentry_t *) chld;
-
+static bool
+tmpfs_match_one(tmpfs_dentry_t *parentp, tmpfs_dentry_t *childp,
+    const char *component)
+{
 	unsigned long key = (unsigned long) parentp;
 	link_t *hlp = hash_table_find(&childp->names, &key);
 	assert(hlp);
 	tmpfs_name_t *namep = hash_table_get_instance(hlp, tmpfs_name_t, link);
-
 	return !strcmp(namep->name, component);
+}
+
+void *tmpfs_match(void *prnt, const char *component)
+{
+	tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt;
+	tmpfs_dentry_t *childp = parentp->child;
+
+	while (childp && !tmpfs_match_one(parentp, childp, component))
+		childp = childp->sibling;
+
+	return (void *) childp;
 }
 
