Index: trunk/kernel/fs/vfs.c
===================================================================
--- trunk/kernel/fs/vfs.c	(revision 634)
+++ trunk/kernel/fs/vfs.c	(revision 635)
@@ -150,4 +150,5 @@
     mapper_t         * mapper;     // associated mapper( to be allocated)
     vfs_inode_t      * inode;      // inode descriptor (to be allocated)
+    
     uint32_t           inum;       // inode identifier (to be allocated)
     vfs_ctx_t        * ctx;        // file system context 
@@ -155,18 +156,4 @@
     error_t            error;
 
-#if DEBUG_VFS_INODE_CREATE
-char           name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t       cycle      = (uint32_t)hal_get_cycles();
-cxy_t          dentry_cxy = GET_CXY( dentry_xp );
-vfs_dentry_t * dentry_ptr = GET_PTR( dentry_xp );
-thread_t *     this       = CURRENT_THREAD;
-if( dentry_xp != XPTR_NULL ) hal_remote_strcpy( XPTR( local_cxy  , name ), 
-                                                XPTR( dentry_cxy , dentry_ptr->name ) );
-else                         strcpy( name , "/" );
-if( DEBUG_VFS_INODE_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, cycle );
-#endif
- 
     // check fs type and get pointer on context
     if     ( fs_type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
@@ -198,9 +185,14 @@
     }
 
-    // allocate memory for VFS inode descriptor
-	req.type  = KMEM_VFS_INODE;
-	req.size  = sizeof(vfs_inode_t);
+// check inode descriptor contained in one page
+assert( (sizeof(vfs_inode_t) <= CONFIG_PPM_PAGE_SIZE),
+"inode descriptor must fit in one page" );
+
+    // allocate one page for VFS inode descriptor
+    // because the embedded "children xhtab footprint
+	req.type  = KMEM_PPM;
+	req.order = 0;
     req.flags = AF_KERNEL | AF_ZERO;
-	inode     = (vfs_inode_t *)kmem_alloc( &req );
+	inode     = kmem_alloc( &req );
 
     if( inode == NULL )
@@ -243,7 +235,10 @@
 
 #if DEBUG_VFS_INODE_CREATE
-cycle      = (uint32_t)hal_get_cycles();
+char           name[CONFIG_VFS_MAX_NAME_LENGTH];
+uint32_t       cycle      = (uint32_t)hal_get_cycles();
+thread_t *     this       = CURRENT_THREAD;
+vfs_inode_get_name( *inode_xp , name );
 if( DEBUG_VFS_INODE_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / inode [%x,%x] / cycle %d\n",
+printk("\n[%s] thread[%x,%x] created <%s> / inode [%x,%x] / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, name, local_cxy, inode, cycle );
 #endif
@@ -261,6 +256,6 @@
     // release memory allocate for inode descriptor
 	kmem_req_t req;
+	req.type  = KMEM_PPM;
 	req.ptr   = inode;
-	req.type  = KMEM_VFS_INODE;
 	kmem_free( &req );
 
@@ -477,12 +472,4 @@
 	kmem_req_t       req;        // request to kernel memory allocator
 
-#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[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, cycle );
-#endif
-
     // get pointer on context
     if     ( fs_type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
@@ -501,8 +488,8 @@
 
     // allocate memory for dentry descriptor
-	req.type  = KMEM_VFS_DENTRY;
-	req.size  = sizeof(vfs_dentry_t);
+	req.type  = KMEM_KCM;
+	req.order = bits_log2( sizeof(vfs_dentry_t) );
     req.flags = AF_KERNEL | AF_ZERO;
-	dentry     = (vfs_dentry_t *)kmem_alloc( &req );
+	dentry    = kmem_alloc( &req );
 
     if( dentry == NULL ) 
@@ -523,7 +510,8 @@
 
 #if DEBUG_VFS_DENTRY_CREATE
-cycle = (uint32_t)hal_get_cycles();
+thread_t * this  = CURRENT_THREAD;
+uint32_t   cycle = (uint32_t)hal_get_cycles();
 if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / dentry [%x,%x] / cycle %d\n",
+printk("\n[%s] thread[%x,%x] created <%s> / dentry [%x,%x] / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, name, local_cxy, dentry, cycle );
 #endif
@@ -538,6 +526,6 @@
     // release memory allocated to dentry
 	kmem_req_t req;
+	req.type  = KMEM_KCM;
 	req.ptr   = dentry;
-	req.type  = KMEM_VFS_DENTRY;
 	kmem_free( &req );
 
@@ -566,8 +554,8 @@
 
     // allocate memory for new file descriptor
-	req.type  = KMEM_VFS_FILE;
-	req.size  = sizeof(vfs_file_t);
+	req.type  = KMEM_KCM;
+	req.order = bits_log2( sizeof(vfs_file_t) );
     req.flags = AF_KERNEL | AF_ZERO;
-	file      = (vfs_file_t *)kmem_alloc( &req );
+	file      = kmem_alloc( &req );
 
     if( file == NULL ) return ENOMEM;
@@ -602,6 +590,6 @@
 {
 	kmem_req_t req;
+	req.type  = KMEM_KCM;
 	req.ptr   = file;
-	req.type  = KMEM_VFS_FILE;
 	kmem_free( &req );
 
@@ -3347,4 +3335,5 @@
 #endif
 
+
     // 3. register new_dentry in new_inode xlist of parents 
     parents_root_xp  = XPTR( child_cxy , &new_inode_ptr->parents );
