Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 619)
+++ trunk/kernel/kern/rpc.c	(revision 623)
@@ -2,5 +2,5 @@
  * rpc.c - RPC operations implementation.
  * 
- * Author    Alain Greiner (2016,2017,2018)
+ * Author    Alain Greiner (2016,2017,2018,2019)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -58,5 +58,5 @@
     &rpc_thread_user_create_server,        // 6
     &rpc_thread_kernel_create_server,      // 7
-    &rpc_undefined,                        // 8    unused slot        
+    &rpc_vfs_fs_update_dentry_server,      // 8
     &rpc_process_sigaction_server,         // 9
 
@@ -67,5 +67,5 @@
     &rpc_vfs_file_create_server,           // 14
     &rpc_vfs_file_destroy_server,          // 15
-    &rpc_vfs_fs_get_dentry_server,         // 16
+    &rpc_vfs_fs_new_dentry_server,         // 16
     &rpc_vfs_fs_add_dentry_server,         // 17
     &rpc_vfs_fs_remove_dentry_server,      // 18
@@ -76,5 +76,5 @@
     &rpc_kcm_alloc_server,                 // 22
     &rpc_kcm_free_server,                  // 23
-    &rpc_undefined,                        // 24   unused slot
+    &rpc_mapper_sync_server,               // 24
     &rpc_mapper_handle_miss_server,        // 25
     &rpc_vmm_delete_vseg_server,           // 26 
@@ -94,5 +94,5 @@
     "THREAD_USER_CREATE",        // 6
     "THREAD_KERNEL_CREATE",      // 7
-    "undefined",                 // 8
+    "VFS_FS_UPDATE_DENTRY",      // 8
     "PROCESS_SIGACTION",         // 9
 
@@ -112,5 +112,5 @@
     "KCM_ALLOC",                 // 22
     "KCM_FREE",                  // 23
-    "undefined",                 // 24
+    "MAPPER_SYNC",               // 24
     "MAPPER_HANDLE_MISS",        // 25
     "VMM_DELETE_VSEG",           // 26
@@ -921,5 +921,5 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [7]      Marshaling functions attached to RPC_THREAD_KERNEL_CREATE (blocking)
+// [7]      Marshaling functions attached to RPC_THREAD_KERNEL_CREATE 
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -1013,7 +1013,87 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [8]   undefined slot
-/////////////////////////////////////////////////////////////////////////////////////////
-
+// [8]   Marshaling functions attached to RPC_VRS_FS_UPDATE_DENTRY
+/////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+void rpc_vfs_fs_update_dentry_client( cxy_t          cxy,
+                                      vfs_inode_t  * inode,
+                                      vfs_dentry_t * dentry,
+                                      uint32_t       size,
+                                      error_t      * error )
+{
+#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+
+    uint32_t responses = 1;
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_VFS_FS_UPDATE_DENTRY;
+    rpc.blocking = true;
+    rpc.rsp      = &responses;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)inode;
+    rpc.args[1] = (uint64_t)(intptr_t)dentry;
+    rpc.args[2] = (uint64_t)size;
+
+    // register RPC request in remote RPC fifo
+    rpc_send( cxy , &rpc );
+
+    // get output values from RPC descriptor
+    *error   = (error_t)rpc.args[3];
+
+#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
+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_vfs_fs_update_dentry_server( xptr_t xp )
+{
+#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+
+    error_t        error;
+    vfs_inode_t  * inode;
+    vfs_dentry_t * dentry;
+    uint32_t       size;
+
+    // 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 arguments
+    inode  = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
+    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
+    size   = (uint32_t)               hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
+
+    // call the kernel function
+    error = vfs_fs_update_dentry( inode , dentry , size );
+
+    // set output argument
+    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
+
+#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+}
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -1110,5 +1190,4 @@
 void rpc_vfs_inode_create_client( cxy_t          cxy,     
                                   uint32_t       fs_type,    // in
-                                  uint32_t       inode_type, // in
                                   uint32_t       attr,       // in
                                   uint32_t       rights,     // in
@@ -1136,9 +1215,8 @@
     // set input arguments in RPC descriptor 
     rpc.args[0] = (uint64_t)fs_type;
-    rpc.args[1] = (uint64_t)inode_type;
-    rpc.args[2] = (uint64_t)attr;
-    rpc.args[3] = (uint64_t)rights;
-    rpc.args[4] = (uint64_t)uid;
-    rpc.args[5] = (uint64_t)gid;
+    rpc.args[1] = (uint64_t)attr;
+    rpc.args[2] = (uint64_t)rights;
+    rpc.args[3] = (uint64_t)uid;
+    rpc.args[4] = (uint64_t)gid;
 
     // register RPC request in remote RPC fifo
@@ -1146,6 +1224,6 @@
 
     // get output values from RPC descriptor
-    *inode_xp = (xptr_t)rpc.args[6];
-    *error    = (error_t)rpc.args[7];
+    *inode_xp = (xptr_t)rpc.args[5];
+    *error    = (error_t)rpc.args[6];
 
 #if DEBUG_RPC_VFS_INODE_CREATE
@@ -1169,5 +1247,4 @@
 
     uint32_t         fs_type;
-    uint32_t         inode_type;
     uint32_t         attr;
     uint32_t         rights;
@@ -1183,13 +1260,11 @@
     // get input arguments from client rpc descriptor
     fs_type    = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    inode_type = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-    attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
-    rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
-    uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
-    gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) );
+    attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
+    rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
+    uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
+    gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
 
     // call local kernel function
     error = vfs_inode_create( fs_type,
-                              inode_type,
                               attr,
                               rights,
@@ -1199,6 +1274,6 @@
 
     // set output arguments
-    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)inode_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[7] ) , (uint64_t)error );
+    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)inode_xp );
+    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
 
 #if DEBUG_RPC_VFS_INODE_CREATE
@@ -1601,5 +1676,5 @@
 
 /////////////////////////////////////////////////////////
-void rpc_vfs_fs_get_dentry_client( cxy_t         cxy,
+void rpc_vfs_fs_new_dentry_client( cxy_t         cxy,
                                    vfs_inode_t * parent_inode,    // in
                                    char        * name,            // in
@@ -1643,5 +1718,5 @@
 
 //////////////////////////////////////////////
-void rpc_vfs_fs_get_dentry_server( xptr_t xp )
+void rpc_vfs_fs_new_dentry_server( xptr_t xp )
 {
 #if DEBUG_RPC_VFS_FS_GET_DENTRY
@@ -1674,5 +1749,5 @@
 
     // call the kernel function
-    error = vfs_fs_get_dentry( parent , name_copy , child_xp );
+    error = vfs_fs_new_dentry( parent , name_copy , child_xp );
 
     // set output argument
@@ -2245,6 +2320,79 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [24]          undefined slot 
-/////////////////////////////////////////////////////////////////////////////////////////
+// [25]          Marshaling functions attached to RPC_MAPPER_SYNC 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////
+void rpc_mapper_sync_client( cxy_t             cxy,
+                             struct mapper_s * mapper,
+                             error_t         * error )
+{
+#if DEBUG_RPC_MAPPER_SYNC
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_MAPPER_SYNC )
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+
+    uint32_t responses = 1;
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_MAPPER_SYNC;
+    rpc.blocking = true;
+    rpc.rsp      = &responses;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)mapper;
+
+    // register RPC request in remote RPC fifo
+    rpc_send( cxy , &rpc );
+
+    // get output values from RPC descriptor
+    *error   = (error_t)rpc.args[1];
+
+#if DEBUG_RPC_MAPPER_SYNC
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_MAPPER_SYNC )
+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_mapper_sync_server( xptr_t xp )
+{
+#if DEBUG_RPC_MAPPER_SYNC
+thread_t * this = CURRENT_THREAD;
+uint32_t cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_MAPPER_SYNC )
+printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+
+    mapper_t * mapper;
+    error_t    error;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = GET_CXY( xp );
+    rpc_desc_t * desc        = GET_PTR( xp );
+
+    // get arguments from client RPC descriptor
+    mapper  = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
+
+    // call local kernel function
+    error = mapper_sync( mapper );
+
+    // set output argument to client RPC descriptor
+    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
+
+#if DEBUG_RPC_MAPPER_SYNC
+cycle = (uint32_t)hal_get_cycles();
+if( cycle > DEBUG_RPC_MAPPER_SYNC )
+printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
+#endif
+}
 
 /////////////////////////////////////////////////////////////////////////////////////////
