Changeset 568 for trunk/kernel/fs/vfs.h
- Timestamp:
- Oct 5, 2018, 12:02:49 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.h
r561 r568 30 30 #include <hal_atomic.h> 31 31 #include <remote_rwlock.h> 32 #include <remote_ spinlock.h>33 #include < spinlock.h>32 #include <remote_busylock.h> 33 #include <busylock.h> 34 34 #include <list.h> 35 35 #include <xlist.h> 36 #include <slist.h>37 36 #include <bits.h> 38 37 #include <xhtab.h> … … 105 104 106 105 /****************************************************************************************** 107 * This structure defines informations common to all inodes and dentries108 * of a given file system. As it is declared a global variable in the kdata segment,109 * it is replicated in all clusters and handled as private by each OS intance.106 * This structure defines a VFS context, that contains informations common to all inodes 107 * and dentries for a given file system. As it is declared as a global variable in the 108 * kdata segment, it is handled as private by each OS intance in a given cluster. 110 109 *****************************************************************************************/ 111 110 … … 134 133 uint32_t cluster_size; /*! cluster size on device (bytes) */ 135 134 xptr_t vfs_root_xp; /*! extended pointer on VFS root inode */ 136 spinlock_t lock; /*! lock protecting inum allocator */135 busylock_t lock; /*! lock protecting inum allocator */ 137 136 uint32_t bitmap[BITMAP_SIZE(CONFIG_VFS_MAX_INODES)]; /* inum allocator */ 138 137 void * extend; /*! FS specific context extension */ … … 143 142 * This structure define a VFS inode. 144 143 * It contains an extended pointer on the parent dentry, and (for directory only) 145 * an hash table xhtab refering all children dentries.146 * The <parent> inode is unique for a directory (no thard links for directories).144 * an hash table (xhtab) registering all children dentries. 145 * The <parent> inode is unique for a directory (no hard links for directories). 147 146 * For a file, the parent field points to the first dentry who created this inode. 148 * Sync rhonisation:149 * - the main_lock ( spinlock) is used during the inode tree traversal or for inode150 * modification (add/remove children).151 * - the data_lock (r wlock) is used during read/write accesses to the data stored152 * in the mapper.153 * - the mapper lock (r wlock) is only used during the radix tree traversal to return154 * t he relevant page for read/write.147 * Synchronisation: 148 * - the main_lock (remote_busylock) is used during the inode tree traversal, 149 * or for inode modification (add/remove children). 150 * - the data_lock (remote_rwlock) is used during read/write accesses to the data 151 * stored in the mapper. 152 * - the mapper lock (remote rwlock) is only used during the radix tree traversal 153 * to return the relevant page for read/write. 155 154 *****************************************************************************************/ 156 155 … … 195 194 xhtab_t children; /*! embedded xhtab of children dentries */ 196 195 remote_rwlock_t data_lock; /*! protect read/write to data and to size */ 197 remote_ spinlock_t main_lock; /*! protect inode tree traversal and modifs */196 remote_busylock_t main_lock; /*! protect inode tree traversal and modifs */ 198 197 list_entry_t list; /*! member of set of inodes in same cluster */ 199 198 xlist_entry_t wait_root; /*! root of threads waiting on this inode */
Note: See TracChangeset
for help on using the changeset viewer.