Index: uspace/srv/fs/tmpfs/tmpfs.h
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.h	(revision 2c448fb8cf0ba4ec2da96ece59966a2ac34eb7ba)
+++ uspace/srv/fs/tmpfs/tmpfs.h	(revision adc8a631eeee9e9aae1471731f01a21ac0e1cf9e)
@@ -55,4 +55,5 @@
 		TMPFS_DIRECTORY
 	} type;
+	unsigned lnkcnt;	/**< Link count. */
 	size_t size;		/**< File size if type is TMPFS_FILE. */
 	void *data;		/**< File content's if type is TMPFS_FILE. */
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 2c448fb8cf0ba4ec2da96ece59966a2ac34eb7ba)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision adc8a631eeee9e9aae1471731f01a21ac0e1cf9e)
@@ -87,5 +87,5 @@
 static unsigned tmpfs_lnkcnt_get(void *nodep)
 {
-	return 1;
+	return ((tmpfs_dentry_t *) nodep)->lnkcnt;
 }
 
@@ -176,4 +176,5 @@
 	dentry->name = NULL;
 	dentry->type = TMPFS_NONE;
+	dentry->lnkcnt = 0;
 	dentry->size = 0;
 	dentry->data = NULL;
@@ -234,4 +235,7 @@
 	if (!name)
 		return false;
+	
+	childp->lnkcnt++;
+	
 	strcpy(name, nm);
 	childp->name = name;
@@ -276,4 +280,6 @@
 	dentry->name = NULL;
 
+	dentry->lnkcnt--;
+
 	return EOK;
 }
@@ -283,4 +289,5 @@
 	tmpfs_dentry_t *dentry = (tmpfs_dentry_t *) nodep;
 	
+	assert(!dentry->lnkcnt);
 	assert(!dentry->child);
 	assert(!dentry->sibling);
