Index: trunk/kernel/vfs/vfs.h
===================================================================
--- trunk/kernel/vfs/vfs.h	(revision 1)
+++ trunk/kernel/vfs/vfs.h	(revision 10)
@@ -166,6 +166,21 @@
  * The <parent> inode is unique for a directory (not hard links for directories). 
  * For a file, the parent field points to the first dentry who created this inode.
- * TODO pourquoi deux types de locks ???
- *****************************************************************************************/
+ * Syncronisation:
+ * - the main_lock (spinlock) is used during the inode tree traversal or for inode
+ *   modification (add/remove children).
+ * - the data_lock (rwlock) is used during read/write accesses to the data stored
+ *   in the mapper. 
+ * - the mapper lock (rwlock) is only used during the radix tree traversal to return
+ *   to return the relevant page for red/write.
+ *****************************************************************************************/
+
+typedef enum   
+{
+    INODE_TYPE_NORMAL,                 /*! file or directory                            */
+    INODE_TYPE_PIPE,                   /*! POSIX pipe                                   */
+    INODE_TYPE_SOCKET,                 /*! POSIX socket                                 */
+    INODE_TYPE_DEV,                    /*! peripheral channel                           */
+}
+vfs_inode_type_t;
 
 typedef enum 
@@ -176,5 +191,5 @@
     INODE_ATTR_NEW    = 0x08,
 }
-inode_attr_t;
+vfs_inode_attr_t;
 
 typedef struct vfs_inode_s
@@ -184,4 +199,5 @@
 	uint32_t                inum;        /*! inode identifier (unique in file system)    */
 	uint32_t                attr;        /*! inode attributes (see above)                */
+	uint32_t                type;        /*! inode type (see above)                      */
 	uint32_t                size;        /*! number of bytes                             */
 	uint32_t                links;       /*! number of alias dentry                      */
@@ -192,6 +208,6 @@
 	xptr_t                  parent_xp;   /*! extended pointer on parent dentry           */
 	xhtab_t                 children;    /*! embedded htab of dir entries (for dir type) */
-	remote_rwlock_t         size_lock;   /*! protect size field modifications            */
-	remote_spinlock_t       main_lock;   /*! protect other fields (including children)   */
+	remote_rwlock_t         data_lock;   /*! protect read/write to data and to size      */
+	remote_spinlock_t       main_lock;   /*! protect inode tree traversal and modifs     */
 	xlist_entry_t           xlist;       /*! member of set of inodes in same cluster     */
 	xlist_entry_t           wait_root;   /*! root of threads waiting on this inode       */
@@ -229,21 +245,13 @@
  *****************************************************************************************/
 
-typedef enum   
-{
-    VFS_FD_NORMAL,                      /*! file or directory                            */
-    VFS_FD_PIPE,                        /*! POSIX pipe                                   */
-    VFS_FD_SOCKET,                      /*! POSIX socket                                 */
-    VFS_FD_DEV,                         /*! peripheral channel                           */
-}
-vfs_fd_type_t;
 
 typedef enum
 {
-    VFS_ATTR_READ_ENABLE  = 0x01,       /*! read access possible                         */
-    VFS_ATTR_WRITE_ENABLE = 0x02,       /*! write access possible                        */
-    VFS_ATTR_APPEND       = 0x04,       /*! append on each write                         */
-    VFS_ATTR_CLOSE_EXEC   = 0x08,       /*! close file on exec                           */
-    VFS_ATTR_SYNC         = 0x10,       /*! synchronise FS on each write                 */
-    VFS_ATTR_IS_DIR       = 0x20,       /*! this is a directory                          */
+    FD_ATTR_READ_ENABLE  = 0x01,       /*! read access possible                         */
+    FD_ATTR_WRITE_ENABLE = 0x02,       /*! write access possible                        */
+    FD_ATTR_APPEND       = 0x04,       /*! append on each write                         */
+    FD_ATTR_CLOSE_EXEC   = 0x08,       /*! close file on exec                           */
+    FD_ATTR_SYNC         = 0x10,       /*! synchronise FS on each write                 */
+    FD_ATTR_IS_DIR       = 0x20,       /*! this is a directory                          */
 }
 vfs_fd_attr_t;
@@ -281,8 +289,15 @@
 vfs_types_t;
 
+typedef enum
+{
+    CTX_ATTR_READ_ONLY    = 0x01,       /*! read access possible                         */
+    CTX_ATTR_SYNC         = 0x10,       /*! synchronise FS on each write                 */
+}
+vfs_ctx_attr_t;
+
 typedef struct vfs_ctx_s
 {
 	uint32_t	              type;          /*! File System type                        */
-	uint32_t	              flags;         /*! TODO ???                                */
+	uint32_t	              attr;          /*! global attributes for all files in FS   */
 	uint32_t                  count;         /*! number of clusters                      */
 	uint32_t                  blksize;       /*! cluster size                            */
