Index: trunk/kernel/fs/vfs.c
===================================================================
--- trunk/kernel/fs/vfs.c	(revision 568)
+++ trunk/kernel/fs/vfs.c	(revision 598)
@@ -126,15 +126,16 @@
 //////////////////////////////////////////////////////////////////////////////////////////
 
-static const char * vfs_inode_type_str( vfs_inode_type_t type )
-{
-    switch ( type ) {
-    case INODE_TYPE_FILE: return "FILE";
-    case INODE_TYPE_DIR:  return "DIR ";
-    case INODE_TYPE_FIFO: return "FIFO";
-    case INODE_TYPE_PIPE: return "PIPE";
-    case INODE_TYPE_SOCK: return "SOCK";
-    case INODE_TYPE_DEV:  return "DEV ";
-    case INODE_TYPE_SYML: return "SYML";
-    default:              return "undefined";
+const char * vfs_inode_type_str( vfs_inode_type_t type )
+{
+    switch ( type ) 
+    {
+        case INODE_TYPE_FILE: return "FILE";
+        case INODE_TYPE_DIR:  return "DIR ";
+        case INODE_TYPE_FIFO: return "FIFO";
+        case INODE_TYPE_PIPE: return "PIPE";
+        case INODE_TYPE_SOCK: return "SOCK";
+        case INODE_TYPE_DEV:  return "DEV ";
+        case INODE_TYPE_SYML: return "SYML";
+        default:              return "undefined";
     }
 }
@@ -168,6 +169,6 @@
 else                         strcpy( name , "/" );
 if( DEBUG_VFS_INODE_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter for <%s> / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, name, cycle );
+printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name, cycle );
 #endif
  
@@ -247,6 +248,6 @@
 cycle      = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_INODE_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x exit for <%s> / inode [%x,%x] / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, name, local_cxy, inode, cycle );
+printk("\n[%s] thread[%x,%x] exit for <%s> / inode [%x,%x] / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name, local_cxy, inode, cycle );
 #endif
  
@@ -284,5 +285,5 @@
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_INODE_LOAD < cycle )
-printk("\n[DBG] %s : thread %x enter for <%s> / cycle %d\n",
+printk("\n[%s] thread %x enter for <%s> / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD , name , cycle );
 #endif
@@ -318,5 +319,5 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_INODE_LOAD < cycle )
-printk("\n[DBG] %s : thread %x exit for <%s> / cycle %d\n",
+printk("\n[%s] thread %x exit for <%s> / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD , name , cycle );
 #endif
@@ -444,8 +445,9 @@
 
 #if DEBUG_VFS_DENTRY_CREATE
+thread_t * this = CURRENT_THREAD;
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter for <%s> / parent_inode %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, name, parent, cycle );
+printk("\n[%s] thread[%x,%x] enter for <%s> / parent_inode %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name, parent, cycle );
 #endif
 
@@ -483,6 +485,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x / dentry <%s> initialised / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, dentry->name, cycle );
+printk("\n[%s] thread[%x,%x] / dentry <%s> initialised / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, dentry->name, cycle );
 #endif
 
@@ -497,6 +499,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x / dentry <%s> registered / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, dentry->name, cycle );
+printk("\n[%s] thread[%x,%x] / dentry <%s> registered / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, dentry->name, cycle );
 #endif
 
@@ -507,6 +509,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[DBG] %s : thread %x in process %x exit for <%s> / dentry %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, name, dentry, cycle );
+printk("\n[%s] thread[%x,%x] exit for <%s> / dentry %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name, dentry, cycle );
 #endif
 
@@ -556,8 +558,9 @@
 
 #if DEBUG_VFS_FILE_CREATE
+thread_t * this = CURRENT_THREAD;
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_OPEN < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter for inode %x in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, inode, local_cxy, cycle );
+printk("\n[%s] thread[%x,%x] enter for inode %x in cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, inode, local_cxy, cycle );
 #endif
 
@@ -587,6 +590,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_OPEN < cycle )
-printk("\n[DBG] %s : thread %x in process %x created file %x in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, file, local_cxy, cycle );
+printk("\n[%s] thread[%x,%x] created file %x in cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, file, local_cxy, cycle );
 #endif
 
@@ -609,8 +612,9 @@
 
 #if DEBUG_VFS_CLOSE
+thread_t * this = CURRENT_THREAD;
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[DBG] %s : thread %x in process %x deleted file %x in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, file, local_cxy, cycle );
+printk("\n[%s] thread[%x,%x] deleted file %x in cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, file, local_cxy, cycle );
 #endif
 
@@ -665,8 +669,9 @@
 
 #if DEBUG_VFS_OPEN
+thread_t * this = CURRENT_THREAD;
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_OPEN < cycle )
-printk("\n[DBG] %s :  thread %x in process %x enter for <%s> / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, path, cycle );
+printk("\n[%s]   thread[%x,%x] enter for <%s> / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, path, cycle );
 #endif
 
@@ -714,7 +719,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_OPEN < cycle )
-printk("\n[DBG] %s :  thread %x in process %x exit for <%s> / fdid %d / cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, path,
-file_id, GET_CXY( file_xp ), cycle );
+printk("\n[%s]   thread[%x,%x] exit for <%s> / fdid %d / cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, path, file_id, GET_CXY( file_xp ), cycle );
 #endif
 
@@ -928,6 +932,6 @@
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter / fdid %d / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, file_id, cycle );
+printk("\n[%s] thread[%x,%x] enter / fdid %d / cycle %d\n",
+__FUNCTION__, process->pid, this->trdid, file_id, cycle );
 #endif
 
@@ -956,5 +960,5 @@
 #if (DEBUG_VFS_CLOSE & 1 )
 if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[DBG] %s : reset fd_array[%d] for process %x in cluster %x\n",
+printk("\n[%s]  reset fd_array[%d] for process %x in cluster %x\n",
 __FUNCTION__, file_id, process_ptr, process_cxy );
 #endif
@@ -981,6 +985,6 @@
 #if (DEBUG_VFS_CLOSE & 1) 
 if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[DBG] %s : thread %x in process %x reset all fd-array copies\n",
-__FUNCTION__, this->trdid, process->pid );
+printk("\n[%s] thread[%x,%x] reset all fd-array copies\n",
+__FUNCTION__, process->pid, this->trdid );
 #endif
 
@@ -1003,6 +1007,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[DBG] %s : thread %x in process %x exit / fdid %d closed / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, file_id, cycle );
+printk("\n[%s] thread[%x,%x] exit / fdid %d closed / cycle %d\n",
+__FUNCTION__, process->pid, this->trdid, file_id, cycle );
 #endif
 
@@ -1020,10 +1024,37 @@
 } 
 
-////////////////////////////////////////
-error_t vfs_stat( xptr_t        file_xp,
-                  struct stat * k_stat )
-{
-    assert( false , "not implemented file_xp: %x, k_stat ptr %x\n",
-      file_xp, k_stat );
+//////////////////////////////////////
+error_t vfs_stat( xptr_t     inode_xp,
+                  stat_t   * st )
+{
+    // get cluster and local pointer on inode descriptor
+    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+
+    // get relevant infos from inode descriptor
+    uint32_t inum   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->inum   ) );
+    uint32_t size   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size   ) );
+    uint32_t uid    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->uid    ) );
+    uint32_t gid    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->gid    ) );
+    uint32_t type   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type   ) );
+    uint32_t rights = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->rights ) );
+
+    // set stat structure fields 
+    st->st_ino  = inum;
+    st->st_gid  = gid;
+    st->st_uid  = uid;
+    st->st_size = size;
+    st->st_mode = (type << 16) | rights;
+
+#if DEBUG_VFS_STAT
+uint32_t cycle  = (uint32_t)hal_get_cycles();
+thread_t * this = CURRENT_THREAD;
+if( DEBUG_VFS_STAT < cycle )
+printk("\n[%s] thread[%x,%x] set stat %x for inode %x in cluster %x / cycle %d\n"
+       " %s / inum %d / size %d\n",
+__FUNCTION__, this->process->pid, this->trdid, st, inode_ptr, inode_cxy, cycle,
+vfs_inode_type_str( type ), inum, size );
+#endif
+
     return 0;
 }
@@ -1155,4 +1186,8 @@
     vfs_inode_t      * inode_ptr;
     vfs_inode_type_t   inode_type;
+    uint32_t           inode_size;
+    uint32_t           inode_inum;
+    uint32_t           inode_attr;
+    uint32_t           inode_dirty;
     xptr_t             children_xp;    // extended pointer on children xhtab
 
@@ -1162,4 +1197,5 @@
     xptr_t             child_inode_xp;
     xptr_t             child_dentry_name_xp;
+    mapper_t         * mapper_ptr;
 
     char               name[CONFIG_VFS_MAX_NAME_LENGTH];
@@ -1182,7 +1218,7 @@
                                         "                              " };  // level 15
 
-    assert( (inode_xp != XPTR_NULL) , "inode_xp cannot be NULL\n" );
-    assert( (name_xp  != XPTR_NULL) , "name_xp cannot be NULL\n" );
-    assert( (indent < 16)           , "depth cannot be larger than 15\n" );
+assert( (inode_xp != XPTR_NULL) , "inode_xp cannot be NULL\n" );
+assert( (name_xp  != XPTR_NULL) , "name_xp cannot be NULL\n" );
+assert( (indent < 16)           , "depth cannot be larger than 15\n" );
     
     // get inode cluster and local pointer
@@ -1190,17 +1226,21 @@
     inode_ptr = GET_PTR( inode_xp );
 
-    // get inode type
-    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-
-    // get local pointer on associated mapper
-    mapper_t * mapper_ptr = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
+    // get inode type, size, attr, mapper, and inum
+    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type   ) );
+    inode_size = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size   ) );
+    inode_inum = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->inum   ) );
+    inode_attr = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->attr   ) );
+    mapper_ptr = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
 
     // make a local copy of node name
     hal_remote_strcpy( XPTR( local_cxy , name ) , name_xp );
 
+    // compute dirty
+    inode_dirty = ((inode_attr & INODE_ATTR_DIRTY) != 0);
+
     // display inode
-    nolock_printk("%s%s <%s> : inode = %x / mapper = %x / cluster %x\n",
+    nolock_printk("%s%s <%s> : inum %d / %d bytes / dirty %d / cxy %x (inode %x / mapper %x)\n",
                   indent_str[indent], vfs_inode_type_str( inode_type ), name,
-                  inode_ptr , mapper_ptr , inode_cxy );
+                  inode_inum, inode_size, inode_dirty, inode_cxy, inode_ptr, mapper_ptr );
 
     // scan directory entries  
@@ -1447,6 +1487,6 @@
 uint32_t cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter for <%s> / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, pathname, cycle );
+printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
+__FUNCTION__, process->pid, this->trdid, pathname, cycle );
 #endif
 
@@ -1479,5 +1519,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : look for <%s> / last = %d\n",
+printk("\n[%s]  look for <%s> / last = %d\n",
 __FUNCTION__ , name , last );
 #endif
@@ -1493,5 +1533,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : miss <%s> node => try to create it\n",
+printk("\n[%s]  miss <%s> node => try to create it\n",
 __FUNCTION__ , name );
 #endif
@@ -1540,5 +1580,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : missing <%s> inode speculatively created / cxy %x / ptr %x\n",
+printk("\n[%s]  missing <%s> inode speculatively created / cxy %x / ptr %x\n",
 __FUNCTION__ , name , child_cxy, child_ptr );
 #endif
@@ -1567,5 +1607,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : created node <%s> in path %s / type DIR\n",
+printk("\n[%s]  created node <%s> in path %s / type DIR\n",
 __FUNCTION__ , name, pathname );
 #endif
@@ -1577,5 +1617,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : created node <%s> in path %s / type FILE\n",
+printk("\n[%s]  created node <%s> in path %s / type FILE\n",
 __FUNCTION__ , name, pathname );
 #endif
@@ -1614,5 +1654,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : load mapper from device for node <%s> in path %s\n",
+printk("\n[%s]  load mapper from device for node <%s> in path %s\n",
 __FUNCTION__ , name, pathname );
 #endif
@@ -1628,5 +1668,5 @@
 #if (DEBUG_VFS_LOOKUP & 1)
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : found <%s> / inode %x in cluster %x\n",
+printk("\n[%s]  found <%s> / inode %x in cluster %x\n",
 __FUNCTION__ , name , GET_PTR(child_xp) , GET_CXY(child_xp) );
 #endif
@@ -1670,7 +1710,7 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[DBG] %s : thread %x in process %x exit for <%s>\n" 
+printk("\n[%s] thread[%x,%x] exit for <%s>\n" 
 "     parent %x in cluster %x / child %x in cluster %x / cycle %d\n",
-__FUNCTION__ , this->trdid, process->pid, pathname, 
+__FUNCTION__ , process->pid, this->trdid, pathname, 
 parent_ptr, parent_cxy, child_ptr, child_cxy, cycle );
 #endif
@@ -1777,7 +1817,6 @@
 thread_t * this = CURRENT_THREAD; 
 if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[DBG] %s : thread %x in process %x enter for <%s>\n"
-"      child_cxy = %x / parent_cxy = %x / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, name,
+printk("\n[%s] thread[%x,%x] enter for <%s> / child_cxy %x / parent_cxy %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name,
 child_cxy, parent_cxy, (uint32_t)hal_get_cycles() );
 #endif
@@ -1810,6 +1849,6 @@
 #if(DEBUG_VFS_ADD_CHILD & 1)
 if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[DBG] %s : thread %x in process %x / dentry <%s> created in cluster %x\n",
-__FUNCTION__, this->trdid, this->process->pid, name, parent_cxy );
+printk("\n[%s] thread[%x,%x] / dentry <%s> created in cluster %x\n",
+__FUNCTION__, this->process->pid, this->trdid, name, parent_cxy );
 #endif
 
@@ -1860,6 +1899,6 @@
 #if(DEBUG_VFS_ADD_CHILD & 1)
 if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[DBG] %s : thread %x in process %x / inode <%s> created in cluster %x\n",
-__FUNCTION__ , this->trdid, this->process->pid, name , child_cxy );
+printk("\n[%s] thread[%x,%x] / inode <%s> created in cluster %x\n",
+__FUNCTION__ , this->process->pid, this->trdid, name , child_cxy );
 #endif
 
@@ -1872,6 +1911,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[DBG] %s : thread %x in process %x exit for <%s> / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, name, (uint32_t)hal_get_cycles() );
+printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, name, (uint32_t)hal_get_cycles() );
 #endif
 
@@ -1952,8 +1991,9 @@
 
 #if DEBUG_VFS_MAPPER_MOVE
-uint32_t cycle = (uint32_t)hal_get_cycles();
+uint32_t   cycle = (uint32_t)hal_get_cycles();
+thread_t * this  = CURRENT_THREAD;
 if( DEBUG_VFS_MAPPER_MOVE < cycle )
-printk("\n[DBG] %s : thread %x enter for page %d / mapper %x / inode %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD, page->index, mapper, mapper->inode, cycle );
+printk("\n[%s] thread[%x,%x] enter for page %d / mapper %x / inode %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, page->index, mapper, mapper->inode, cycle );
 #endif
 
@@ -1989,6 +2029,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_MAPPER_MOVE < cycle )
-printk("\n[DBG] %s : thread %x exit for page %d / mapper %x / inode %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD, page->index, mapper, mapper->inode, cycle );
+printk("\n[%s] thread[%x,%x] exit for page %d / mapper %x / inode %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, page->index, mapper, mapper->inode, cycle );
 #endif
 
@@ -2008,11 +2048,12 @@
     uint32_t   size   = inode->size;
 
-    assert( (mapper != NULL) , "mapper pointer is NULL\n" );
+assert( (mapper != NULL) , "mapper pointer is NULL\n" );
 
 #if DEBUG_VFS_MAPPER_LOAD
-uint32_t cycle = (uint32_t)hal_get_cycles();
+uint32_t   cycle = (uint32_t)hal_get_cycles();
+thread_t * this  = CURRENT_THREAD;
 if( DEBUG_VFS_MAPPER_MOVE < cycle )
-printk("\n[DBG] %s : thread %x enter for inode %x in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle );
+printk("\n[%s] thread[%x,%x] enter for inode %x in cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, inode, local_cxy, cycle );
 #endif
 
@@ -2034,6 +2075,6 @@
 cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_MAPPER_MOVE < cycle )
-printk("\n[DBG] %s : thread %x exit for inode %x in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle );
+printk("\n[%s] thread[%x,%x] exit for inode %x in cluster %x / cycle %d\n",
+__FUNCTION__, this->process->pid, this->trdid, inode, local_cxy, cycle );
 #endif
 
