Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 611)
+++ trunk/kernel/kern/rpc.c	(revision 612)
@@ -29,4 +29,5 @@
 #include <hal_special.h>
 #include <printk.h>
+#include <user_dir.h>
 #include <remote_sem.h>
 #include <core.h>
@@ -66,5 +67,5 @@
     &rpc_vfs_file_create_server,           // 14
     &rpc_vfs_file_destroy_server,          // 15
-    &rpc_vfs_fs_child_init_server,         // 16
+    &rpc_vfs_fs_get_dentry_server,         // 16
     &rpc_vfs_fs_add_dentry_server,         // 17
     &rpc_vfs_fs_remove_dentry_server,      // 18
@@ -102,5 +103,5 @@
     "VFS_FILE_CREATE",           // 14
     "VFS_FILE_DESTROY",          // 15
-    "VFS_FS_CHILD_INIT",         // 16
+    "VFS_FS_GET_DENTRY",         // 16
     "VFS_FS_ADD_DENTRY",         // 17
     "VFS_FS_REMOVE_DENTRY",      // 18
@@ -650,10 +651,148 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [4]      undefined slot
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [5]      undefined slot
-/////////////////////////////////////////////////////////////////////////////////////////
+// [4]      Marshaling functions attached to RPC_USER_DIR_CREATE (blocking) 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////
+void rpc_user_dir_create_client( cxy_t          cxy,
+                                 vfs_inode_t *  inode,
+                                 user_dir_t  ** dir )
+{
+#if DEBUG_RPC_USER_DIR_CREATE
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_CREATE)
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+
+    assert( (cxy != local_cxy) , "server cluster is not remote\n");
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_USER_DIR_CREATE;
+    rpc.blocking = true;
+    rpc.responses = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)inode;
+
+    // register RPC request in remote RPC fifo
+    rpc_send( cxy , &rpc );
+
+    // get output argument from RPC descriptor
+    *dir = (user_dir_t *)(intptr_t)rpc.args[1];
+
+#if DEBUG_RPC_USER_DIR_CREATE
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_CREATE)
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+}
+
+////////////////////////////////////////////
+void rpc_user_dir_create_server( xptr_t xp )
+{
+#if DEBUG_RPC_USER_DIR_CREATE
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_CREATE)
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+
+    vfs_inode_t * inode;          // pointer on inode in server cluster
+    user_dir_t  * dir;            // pointer on user_dir structure in server cluster 
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
+
+    // get input argument from RPC descriptor
+    inode = (vfs_inode_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
+
+    // call kernel function
+    dir = user_dir_create( inode );
+
+    // set output argument into RPC descriptor
+    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (intptr_t)dir );
+
+#if DEBUG_RPC_USER_DIR_CREATE
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_CREATE)
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// [5]      Marshaling functions attached to RPC_USER_DIR_DESTROY (blocking) 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////
+void rpc_user_dir_destroy_client( cxy_t         cxy,
+                                  user_dir_t  * dir )
+{
+#if DEBUG_RPC_USER_DIR_DESTROY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+
+    assert( (cxy != local_cxy) , "server cluster is not remote\n");
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_USER_DIR_DESTROY;
+    rpc.blocking = true;
+    rpc.responses = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)dir;
+
+    // register RPC request in remote RPC fifo
+    rpc_send( cxy , &rpc );
+
+#if DEBUG_RPC_USER_DIR_DESTROY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+}
+
+/////////////////////////////////////////////
+void rpc_user_dir_destroy_server( xptr_t xp )
+{
+#if DEBUG_RPC_USER_DIR_DESTROY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+
+    user_dir_t * dir;            // pointer on user_dir structure in server cluster 
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
+
+    // get input argument from RPC descriptor
+    dir = (user_dir_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
+
+    // call kernel function
+    user_dir_destroy( dir );
+
+#if DEBUG_RPC_USER_DIR_DESTROY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
+#endif
+}
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -731,6 +870,4 @@
     cxy_t        client_cxy  = GET_CXY( xp );
     rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get pointer on attributes structure in client cluster from RPC descriptor
 
     // get input arguments from RPC descriptor
@@ -751,5 +888,4 @@
                                 &attr_copy,
                                 &thread_ptr );
-
     // set output arguments
     thread_xp = XPTR( local_cxy , thread_ptr );
@@ -1426,9 +1562,9 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [16]      Marshaling functions attached to RPC_VFS_FS_CHILD_INIT  (blocking)
+// [16]      Marshaling functions attached to RPC_VFS_FS_GET_DENTRY  (blocking)
 /////////////////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////
-void rpc_vfs_fs_child_init_client( cxy_t         cxy,
+void rpc_vfs_fs_get_dentry_client( cxy_t         cxy,
                                    vfs_inode_t * parent_inode,    // in
                                    char        * name,            // in
@@ -1436,8 +1572,8 @@
                                    error_t     * error )          // out
 {
-#if DEBUG_RPC_VFS_FS_CHILD_INIT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
+#if DEBUG_RPC_VFS_FS_GET_DENTRY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_GET_DENTRY )
 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
@@ -1448,5 +1584,5 @@
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FS_CHILD_INIT;
+    rpc.index    = RPC_VFS_FS_GET_DENTRY;
     rpc.blocking = true;
     rpc.responses = 1;
@@ -1463,7 +1599,7 @@
     *error   = (error_t)rpc.args[3];
 
-#if DEBUG_RPC_VFS_FS_CHILD_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
+#if DEBUG_RPC_VFS_FS_GET_DENTRY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_GET_DENTRY )
 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
@@ -1472,10 +1608,10 @@
 
 //////////////////////////////////////////////
-void rpc_vfs_fs_child_init_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FS_CHILD_INIT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
+void rpc_vfs_fs_get_dentry_server( xptr_t xp )
+{
+#if DEBUG_RPC_VFS_FS_GET_DENTRY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_GET_DENTRY )
 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
@@ -1503,12 +1639,12 @@
 
     // call the kernel function
-    error = vfs_fs_child_init( parent , name_copy , child_xp );
+    error = vfs_fs_get_dentry( parent , name_copy , child_xp );
 
     // set output argument
     hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
 
-#if DEBUG_RPC_VFS_FS_CHILD_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT )
+#if DEBUG_RPC_VFS_FS_GET_DENTRY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_GET_DENTRY )
 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
