Index: trunk/kernel/fs/vfs.c
===================================================================
--- trunk/kernel/fs/vfs.c	(revision 611)
+++ trunk/kernel/fs/vfs.c	(revision 612)
@@ -2350,5 +2350,5 @@
                 if( parent_cxy == local_cxy )
                 {
-                    error = vfs_fs_child_init( parent_ptr,
+                    error = vfs_fs_get_dentry( parent_ptr,
                                                name,
                                                child_xp );
@@ -2356,5 +2356,5 @@
                 else
                 {
-                    rpc_vfs_fs_child_init_client( parent_cxy,
+                    rpc_vfs_fs_get_dentry_client( parent_cxy,
                                                   parent_ptr,
                                                   name,
@@ -2367,7 +2367,7 @@
                     if ( last && create )  // add a brand new dentry in parent
                     {
-                        error = vfs_new_child_init( parent_xp,                
-                                                    dentry_xp,
-                                                    child_xp );
+                        error = vfs_new_dentry_init( parent_xp,                
+                                                     dentry_xp,
+                                                     child_xp );
                         if ( error )
                         {
@@ -2510,8 +2510,8 @@
 }  // end vfs_lookup()
 
-///////////////////////////////////////////////
-error_t vfs_new_child_init( xptr_t   parent_xp,
-                            xptr_t   dentry_xp,
-                            xptr_t   child_xp )
+////////////////////////////////////////////////
+error_t vfs_new_dentry_init( xptr_t   parent_xp,
+                             xptr_t   dentry_xp,
+                             xptr_t   child_xp )
 {
     error_t     error;
@@ -2599,5 +2599,5 @@
     return 0;
 
-}  // end vfs_new_child_init()
+}  // end vfs_new_dentry_init()
 
 ///////////////////////////////////////////////////
@@ -2615,6 +2615,6 @@
     vfs_dentry_t  * dentry_ptr;        // local pointer on dentry (used for . and ..) 
 
-    xptr_t          parents_root_xp;   // extended pointer on inode "parents" field
-    xptr_t          parents_entry_xp;  // extended pointer on dentry "parents" field
+    // xptr_t          parents_root_xp;   // extended pointer on inode "parents" field
+    // xptr_t          parents_entry_xp;  // extended pointer on dentry "parents" field
     xptr_t          children_xhtab_xp; // extended pointer on inode "children" field
     xptr_t          children_entry_xp; // extended pointer on dentry "children" field
@@ -2628,5 +2628,5 @@
 vfs_inode_get_name( parent_xp , parent_name );
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] enter / child <%s> / parent <%s> / cycle %d\n",
+printk("\n[%s] thread[%x,%x] enter for child <%s> in parent <%s> / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cycle );
 #endif
@@ -2686,9 +2686,10 @@
     }
 
-    // register <.> dentry in child_inode xlist of parents TODO faut-il ?
-    parents_root_xp  = XPTR( child_cxy , &child_ptr->parents );
-    parents_entry_xp = XPTR( child_cxy , &dentry_ptr->parents );
-    xlist_add_first( parents_root_xp , parents_entry_xp );
-    hal_remote_atomic_add( XPTR( child_cxy , &child_ptr->links ) , 1 );
+    
+    // don't register <.> dentry in child_inode xlist of parents 
+    // parents_root_xp  = XPTR( child_cxy , &child_ptr->parents );
+    // parents_entry_xp = XPTR( child_cxy , &dentry_ptr->parents );
+    // xlist_add_first( parents_root_xp , parents_entry_xp );
+    // hal_remote_atomic_add( XPTR( child_cxy , &child_ptr->links ) , 1 );
 
     // update "parent" and "child_xp" fields in <.> dentry
@@ -2770,9 +2771,9 @@
     }
 
-    // register <..> dentry in parent_inode xlist of parents TODO faut-il ?
-    parents_root_xp  = XPTR( parent_cxy , &parent_ptr->parents );
-    parents_entry_xp = XPTR( child_cxy  , &dentry_ptr->parents );
-    xlist_add_first( parents_root_xp , parents_entry_xp );
-    hal_remote_atomic_add( XPTR( parent_cxy , &parent_ptr->links ) , 1 );
+    // don't register <..> dentry in parent_inode xlist of parents 
+    // parents_root_xp  = XPTR( parent_cxy , &parent_ptr->parents );
+    // parents_entry_xp = XPTR( child_cxy  , &dentry_ptr->parents );
+    // xlist_add_first( parents_root_xp , parents_entry_xp );
+    // hal_remote_atomic_add( XPTR( parent_cxy , &parent_ptr->links ) , 1 );
 
     // update "parent" and "child_xp" fields in <..> dentry
@@ -2815,6 +2816,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, (uint32_t)hal_get_cycles() );
+printk("\n[%s] thread[%x,%x] exit for child <%s> in parent <%s> / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cycle );
 #endif
 
@@ -3183,4 +3184,7 @@
 }  // end vfs_remove_child_from_parent()
 
+
+
+
 //////////////////////////////////////////////////////////////////////////////////////////
 //    API used by VFS to access a specific FS  
@@ -3251,9 +3255,9 @@
     else if( fs_type == FS_TYPE_RAMFS )
     {
-        assert( false , "should not be called for RAMFS\n" );
+        error = 0;     // does nothing for RAMFS
     }
     else if( fs_type == FS_TYPE_DEVFS )
     {
-        assert( false , "should not be called for DEVFS\n" );
+        error = 0;     // does nothing for DEVFS
     }
     else
@@ -3289,9 +3293,9 @@
     else if( fs_type == FS_TYPE_RAMFS )
     {
-        assert( false , "should not be called for RAMFS\n" );
+        error = 0;     // does nothing for RAMFS
     }
     else if( fs_type == FS_TYPE_DEVFS )
     {
-        assert( false , "should not be called for DEVFS\n" );
+        error = 0;     // does nothing for DEVFS
     }
     else
@@ -3305,5 +3309,5 @@
 
 ////////////////////////////////////////////////
-error_t vfs_fs_child_init( vfs_inode_t * parent,
+error_t vfs_fs_get_dentry( vfs_inode_t * parent,
                            char        * name,
                            xptr_t        child_xp )
@@ -3321,5 +3325,5 @@
     if( fs_type == FS_TYPE_FATFS )
     {
-        error = fatfs_child_init( parent , name , child_xp );
+        error = fatfs_get_dentry( parent , name , child_xp );
     }
     else if( fs_type == FS_TYPE_RAMFS )
@@ -3338,6 +3342,67 @@
     return error;
 
-} // end vfs_fs_child_init()
-
+} // end vfs_fs_get_dentry()
+
+///////////////////////////////////////////////////
+error_t vfs_fs_get_user_dir( vfs_inode_t   * inode,
+                             struct dirent * array,
+                             uint32_t        max_dirent,
+                             uint32_t        min_dentry,
+                             bool_t          detailed,
+                             uint32_t      * entries,
+                             bool_t        * done )
+{
+    error_t error = 0;
+
+// check arguments
+assert( (inode != NULL) , "parent pointer is NULL\n");
+assert( (array != NULL) , "child pointer is NULL\n");
+assert( (detailed == false) , "detailed argument not supported\n");
+
+    // check inode type
+    if( inode->type != INODE_TYPE_DIR )
+    {
+        printk("\n[ERROR] in %s : target inode is not a directory\n",
+        __FUNCTION__ );
+        return -1;
+    }
+
+    // get parent inode FS type
+    vfs_fs_type_t fs_type = inode->ctx->type;
+
+    // call relevant FS function
+    if( fs_type == FS_TYPE_FATFS )
+    {
+        error = fatfs_get_user_dir( inode, 
+                                    array,
+                                    max_dirent,
+                                    min_dentry,
+                                    detailed,
+                                    entries,
+                                    done );
+    }
+    else if( fs_type == FS_TYPE_RAMFS )
+    {
+        assert( false , "should not be called for RAMFS\n" );
+    }
+    else if( fs_type == FS_TYPE_DEVFS )
+    {
+        error = devfs_get_user_dir( inode,
+                                    array,
+                                    max_dirent,
+                                    min_dentry,
+                                    detailed,
+                                    entries,
+                                    done );
+    }
+    else
+    {
+        assert( false , "undefined file system type\n" );
+    }
+
+    return error;
+
+}  // end vfs_fs_get_user_dir()
+ 
 ////////////////////////////////////////////////
 error_t vfs_fs_sync_inode( vfs_inode_t * inode )
