Index: trunk/kernel/fs/vfs.h
===================================================================
--- trunk/kernel/vfs/vfs.h	(revision 317)
+++ trunk/kernel/fs/vfs.h	(revision 407)
@@ -38,6 +38,5 @@
 #include <xhtab.h>
 #include <errno.h>
-#include <metafs.h>
-
+#include <shared_syscalls.h>
 #include <fatfs.h>
 #include <ramfs.h>
@@ -235,12 +234,4 @@
 typedef enum
 {
-    VFS_SEEK_SET,
-    VFS_SEEK_CUR,
-    VFS_SEEK_END,
-}
-vfs_lseek_cmd_t;
-
-typedef enum
-{
     FD_ATTR_READ_ENABLE    = 0x01,     /*! read access possible                         */
     FD_ATTR_WRITE_ENABLE   = 0x02,     /*! write access possible                        */
@@ -267,41 +258,4 @@
 vfs_file_t;
 
-/******************************************************************************************
- * This structure define the informations associated to a file descriptor,
- * returned to user space by the stat() system call.
- *****************************************************************************************/
-
-typedef struct vfs_stat_s 
-{
-	uint32_t    dev;        /*! ID of device containing file                             */
-	uint32_t    ino;        /*! inode number                                             */
-	uint32_t    mode;       /*! protection                                               */
-	uint32_t    nlink;      /*! number of hard links                                     */
-	uint32_t    uid;        /*! user ID of owner                                         */
-	uint32_t    gid;        /*! group ID of owner                                        */
-	uint32_t    rdev;       /*! device ID (if special file)                              */
-	uint64_t    size;       /*! total size, in bytes                                     */
-	uint32_t    blksize;    /*! blocksize for file system I/O                            */
-	uint32_t    blocks;     /*! number of 512B blocks allocated                          */
-	uint64_t    atime;      /*! time of last access                                      */
-	uint64_t    mtime;      /*! time of last modification                                */
-	uint64_t    ctime;      /*! time of last status change                               */
-}
-vfs_stat_t;
-
-/*********************************************************************************************
- * This structure defines the information associated to a directory entry,
- * returned to user space by the readdir() system call.
- ********************************************************************************************/
-
-typedef struct vfs_dirent_s
-{
-    uint32_t    inum;                               /*! inode identifier                    */
-    uint32_t    type;                               /*! inode type                          */
-    char        name[CONFIG_VFS_MAX_NAME_LENGTH];   /*! dentry name                         */
-}
-vfs_dirent_t;
-
-
 
 /*****************************************************************************************/
@@ -503,22 +457,4 @@
 error_t vfs_inode_unlink( vfs_inode_t * inode );
 
-/****************************************************************************************** 
- * This function TODO                                                          
- *****************************************************************************************/
-error_t vfs_inode_stat( vfs_inode_t * inode,
-                        uint32_t      inum );
-
-/****************************************************************************************** 
- * This function TODO                                                          
- *****************************************************************************************/
-error_t vfs_icache_del( vfs_inode_t * inode );
-
-
-/****************************************************************************************** 
- * This function TODO  Pourquoi 2 arguments ?
- *****************************************************************************************/
-error_t vfs_stat_inode( vfs_inode_t * inode,
-                        uint32_t      inum );
-
 
 /*****************************************************************************************/
@@ -643,6 +579,6 @@
  * @ lookup_mode : flags defining the working mode (defined above in this file).
  * @ inode_xp    : [out] buffer for extended pointer on searched inode.
- * @ return 0 if success / ENOENT if inode not found , EACCES if permissopn denied,
- *                        EAGAIN if a new complete lookup must be made
+ * @ return 0 if success / ENOENT if inode not found , EACCES if permisson denied,
+ *                         EAGAIN if a new complete lookup must be made
  *****************************************************************************************/
 error_t vfs_lookup( xptr_t             cwd_xp,
@@ -653,5 +589,5 @@
 /******************************************************************************************
  * This function creates a new couple dentry/inode, and insert it in the Inode-Tree.
- * It can be executed by any thread running in any cluster ( can be differente from both
+ * It can be executed by any thread running in any cluster (can be different from both
  * the child cluster and the parent cluster), as it uses the rpc_dentry_create_client()
  * and rpc_inode_create client() if required. This is done in three steps:
@@ -707,16 +643,17 @@
 /****************************************************************************************** 
  * This function allocates a vfs_file_t structure in the cluster containing the inode
- * associated to the file identified by <cwd_xp> & <path>.
- * It initializes it, register it in the reference process fd_array, and returns both 
- * the extended pointer on the remote file descriptor, and the index in the fd_array. 
+ * associated to the file identified by the <cwd_xp> & <path> arguments.
+ * It initializes it, register it in the reference process fd_array identified by the
+ * <process> argument, and returns both the extended pointer on the file descriptor,
+ * and the allocated index in the fd_array. 
  * The pathname can be relative to current directory or absolute.
  * If the inode does not exist in the inode cache, it try to find the file on the mounted
  * device, and creates an inode on a pseudo randomly selected cluster if found.
  * It the requested file does not exist on device, it creates a new inode if the
- * O_CREAT flag is set and return an error otherwise. 
- ****************************************************************************************** 
- * @ cwd_xp      : extended pointer on current working directory file descriptor.
+ * O_CREAT flag is set, and return an error otherwise. 
+ ****************************************************************************************** 
+ * @ process     : local pointer on local process descriptor copy.
  * @ path        : file pathname (absolute or relative to current directory).
- * @ flags       : defined above 
+ * @ flags       : defined above.
  * @ mode        : access rights (as defined by chmod)
  * @ file_xp     : [out] buffer for extended pointer on created remote file descriptor.
@@ -724,10 +661,10 @@
  * @ return 0 if success / return non-zero if error.
  *****************************************************************************************/
-error_t vfs_open( xptr_t     cwd_xp,
-		          char     * path,
-		          uint32_t   flags,
-                  uint32_t   mode,
-		          xptr_t   * file_xp,
-		          uint32_t * file_id );
+error_t vfs_open( struct process_s * process,
+		          char             * path,
+		          uint32_t           flags,
+                  uint32_t           mode,
+		          xptr_t           * file_xp,
+		          uint32_t         * file_id );
 
 /****************************************************************************************** 
@@ -735,5 +672,5 @@
  * <file_xp> argument, and a - possibly distributed - user space <buffer>, taken into 
  * account the offset in <file_xp>. The transfer direction is defined by <to_buffer>.
- * This function is called by the elf_load_process() function.
+ * It is called by the sys_read() and sys_write() functions.
  ******************************************************************************************
  * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 
@@ -741,10 +678,10 @@
  * @ buffer    : user space pointer on buffer (can be physically distributed).
  * @ size      : requested number of bytes from offset.
- * @ returns 0 f success / -1 if error.
- *****************************************************************************************/
-error_t vfs_user_move( bool_t   to_buffer,
-                       xptr_t   file_xp, 
-                       void   * buffer,
-                       uint32_t size );
+ * @ returns number of bytes actually moved if success / -1 if error.
+ *****************************************************************************************/
+int vfs_user_move( bool_t   to_buffer,
+                   xptr_t   file_xp, 
+                   void   * buffer,
+                   uint32_t size );
 
 /****************************************************************************************** 
@@ -752,5 +689,5 @@
  * <file_xp> argument, and a - possibly remote - kernel <buffer_xp>, taken into 
  * account the offset in <file_xp>. The transfer direction is defined by <to_buffer>.
- * This function is called by the  system calls.
+ * It is called by the elf_load_process() function.
  ******************************************************************************************
  * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 
@@ -758,5 +695,5 @@
  * @ buffer_xp : user space pointer on buffer (can be physically distributed).
  * @ size      : requested number of bytes from offset.
- * @ returns number of bytes actually transfered / -1 if error.
+ * @ returns 0 if success / -1 if error.
  *****************************************************************************************/
 error_t vfs_kernel_move( bool_t   to_buffer,
@@ -814,9 +751,9 @@
  ******************************************************************************************
  * @ file_xp    : extended pointer on the file descriptor of the searched directory .
- * @ k_dirent   : local pointer on the dirent_t structure in kernel space.
+ * @ k_stat     : local pointer on the stat structure in kernel space.
  * @ returns 0 if success / -1 if error.
  *****************************************************************************************/
-error_t vfs_stat( xptr_t       file_xp,
-                  vfs_stat_t * k_stat );
+error_t vfs_stat( xptr_t        file_xp,
+                  struct stat * k_stat );
 
 /****************************************************************************************** 
@@ -826,9 +763,9 @@
  ******************************************************************************************
  * @ file_xp    : extended pointer on the file descriptor of the searched directory .
- * @ k_dirent   : local pointer on the dirent_t structure in kernel space.
+ * @ k_dirent   : local pointer on the dirent structure in kernel space.
  * @ returns 0 if success / -1 if error.
  *****************************************************************************************/
-error_t vfs_readdir( xptr_t         file_xp,
-                     vfs_dirent_t * k_dirent );
+error_t vfs_readdir( xptr_t          file_xp,
+                     struct dirent * k_dirent );
 
 /****************************************************************************************** 
