Index: uspace/srv/fs/minixfs/mfs.c
===================================================================
--- uspace/srv/fs/minixfs/mfs.c	(revision 557ea4f6be3897ffde3eb918b09add1a594b9911)
+++ uspace/srv/fs/minixfs/mfs.c	(revision ac28650c777e9db77b896b63c3b1107e9a797daa)
@@ -48,6 +48,4 @@
 #include <stdio.h>
 #include "mfs.h"
-
-#define NAME	"mfs"
 
 vfs_info_t mfs_vfs_info = {
Index: uspace/srv/fs/minixfs/mfs.h
===================================================================
--- uspace/srv/fs/minixfs/mfs.h	(revision 557ea4f6be3897ffde3eb918b09add1a594b9911)
+++ uspace/srv/fs/minixfs/mfs.h	(revision ac28650c777e9db77b896b63c3b1107e9a797daa)
@@ -39,4 +39,6 @@
 #include <adt/list.h>
 #include "../../vfs/vfs.h"
+
+#define NAME		"mfs"
 
 #define DEBUG_MODE
@@ -125,16 +127,6 @@
 extern void mfs_mount(ipc_callid_t rid, ipc_call_t *request);
 extern void mfs_lookup(ipc_callid_t rid, ipc_call_t *request);
-extern aoff64_t mfs_size_get(fs_node_t *node);
-extern bool mfs_is_directory(fs_node_t *fsnode);
-extern bool mfs_is_file(fs_node_t *fsnode);
-extern char mfs_plb_get_char(unsigned pos);
-extern int mfs_has_children(bool *has_children, fs_node_t *fsnode);
-extern int mfs_root_get(fs_node_t **rfn, devmap_handle_t handle);
-extern devmap_handle_t mfs_device_get(fs_node_t *fsnode);
 extern int mfs_instance_get(devmap_handle_t handle,
 				struct mfs_instance **instance);
-extern
-int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle,
-			fs_index_t index);
 
 extern void mfs_stat(ipc_callid_t rid, ipc_call_t *request);
Index: uspace/srv/fs/minixfs/mfs_dentry.c
===================================================================
--- uspace/srv/fs/minixfs/mfs_dentry.c	(revision 557ea4f6be3897ffde3eb918b09add1a594b9911)
+++ uspace/srv/fs/minixfs/mfs_dentry.c	(revision ac28650c777e9db77b896b63c3b1107e9a797daa)
@@ -50,5 +50,5 @@
 		return NULL;
 
-	int r = read_map(&block, mnode, index *sbi->dirsize);
+	int r = read_map(&block, mnode, index * sbi->dirsize);
 
 	if (r != EOK || block == 0)
Index: uspace/srv/fs/minixfs/mfs_ops.c
===================================================================
--- uspace/srv/fs/minixfs/mfs_ops.c	(revision 557ea4f6be3897ffde3eb918b09add1a594b9911)
+++ uspace/srv/fs/minixfs/mfs_ops.c	(revision ac28650c777e9db77b896b63c3b1107e9a797daa)
@@ -48,4 +48,16 @@
 static fs_index_t mfs_index_get(fs_node_t *fsnode);
 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode);
+static char mfs_plb_get_char(unsigned pos);
+static bool mfs_is_directory(fs_node_t *fsnode);
+static bool mfs_is_file(fs_node_t *fsnode);
+static int mfs_has_children(bool *has_children, fs_node_t *fsnode);
+static int mfs_root_get(fs_node_t **rfn, devmap_handle_t handle);
+static devmap_handle_t mfs_device_get(fs_node_t *fsnode);
+static aoff64_t mfs_size_get(fs_node_t *node);
+
+static
+int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle,
+			fs_index_t index);
+
 
 static LIST_INITIALIZE(inst_list);
@@ -221,7 +233,6 @@
 }
 
-aoff64_t mfs_size_get(fs_node_t *node)
-{
-	mfsdebug("request for inode size\n");
+static aoff64_t mfs_size_get(fs_node_t *node)
+{
 	assert(node);
 
@@ -241,5 +252,5 @@
 }
 
-int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle,
+static int mfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle,
 			fs_index_t index)
 {
@@ -277,5 +288,4 @@
 static int mfs_node_open(fs_node_t *fsnode)
 {
-	mfsdebug("mfs_node_open()\n");
 	/*
 	 * Opening a file is stateless, nothing
@@ -363,5 +373,5 @@
 }
 
-bool mfs_is_directory(fs_node_t *fsnode)
+static bool mfs_is_directory(fs_node_t *fsnode)
 {
 	const struct mfs_node *node = fsnode->data;
@@ -369,5 +379,5 @@
 }
 
-bool mfs_is_file(fs_node_t *fsnode)
+static bool mfs_is_file(fs_node_t *fsnode)
 {
 	struct mfs_node *node = fsnode->data;
@@ -375,5 +385,5 @@
 }
 
-int mfs_root_get(fs_node_t **rfn, devmap_handle_t handle)
+static int mfs_root_get(fs_node_t **rfn, devmap_handle_t handle)
 {
 	int rc = mfs_node_get(rfn, handle, MFS_ROOT_INO);
@@ -388,10 +398,10 @@
 }
 
-char mfs_plb_get_char(unsigned pos)
+static char mfs_plb_get_char(unsigned pos)
 {
 	return mfs_reg.plb_ro[pos % PLB_SIZE];
 }
 
-int mfs_has_children(bool *has_children, fs_node_t *fsnode)
+static int mfs_has_children(bool *has_children, fs_node_t *fsnode)
 {
 	struct mfs_node *mnode = fsnode->data;
@@ -399,5 +409,5 @@
 	const struct mfs_instance *inst = mnode->instance;
 	const struct mfs_sb_info *sbi = inst->sbi;
-	int i;
+	uint32_t n_dentries = 0;
 
 	*has_children = false;
@@ -407,7 +417,15 @@
 
 	struct mfs_dentry_info *d_info;
-
-	for (i = 2; i < ino_i->i_size / sbi->dirsize; ++i) {
-		d_info = read_directory_entry(mnode, i);
+	n_dentries =  ino_i->i_size / sbi->dirsize;
+	
+	/* The first two dentries are always . and .. */
+	assert(n_dentries >= 2);
+
+	if (n_dentries == 2)
+		goto out;
+
+	int i = 2;
+	while (1) {
+		d_info = read_directory_entry(mnode, i++);
 
 		if (!d_info)
@@ -424,4 +442,7 @@
 
 out:
+
+	if (n_dentries > 2 && !*has_children)
+		printf(NAME ": Filesystem corruption detected");
 
 	if (*has_children)
