Changeset 568 for trunk/kernel/fs/vfs.h


Ignore:
Timestamp:
Oct 5, 2018, 12:02:49 AM (6 years ago)
Author:
alain
Message:

omplete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/fs/vfs.h

    r561 r568  
    3030#include <hal_atomic.h>
    3131#include <remote_rwlock.h>
    32 #include <remote_spinlock.h>
    33 #include <spinlock.h>
     32#include <remote_busylock.h>
     33#include <busylock.h>
    3434#include <list.h>
    3535#include <xlist.h>
    36 #include <slist.h>
    3736#include <bits.h>
    3837#include <xhtab.h>
     
    105104
    106105/******************************************************************************************
    107  * This structure defines informations common to all inodes and dentries
    108  * 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.
    110109 *****************************************************************************************/
    111110
     
    134133        uint32_t       cluster_size;             /*! cluster size on device (bytes)          */
    135134        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          */
    137136    uint32_t       bitmap[BITMAP_SIZE(CONFIG_VFS_MAX_INODES)];  /* inum allocator        */
    138137    void         * extend;                   /*! FS specific context extension           */
     
    143142 * This structure define a VFS inode.
    144143 * 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 (not hard 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).
    147146 * For a file, the parent field points to the first dentry who created this inode.
    148  * Syncrhonisation:
    149  * - the main_lock (spinlock) is used during the inode tree traversal or for inode
    150  *   modification (add/remove children).
    151  * - the data_lock (rwlock) is used during read/write accesses to the data stored
    152  *   in the mapper.
    153  * - the mapper lock (rwlock) is only used during the radix tree traversal to return
    154  *   the 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.
    155154 *****************************************************************************************/
    156155
     
    195194        xhtab_t            children;         /*! embedded xhtab of children dentries         */
    196195        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     */
    198197        list_entry_t       list;             /*! member of set of inodes in same cluster     */
    199198        xlist_entry_t      wait_root;        /*! root of threads waiting on this inode       */
Note: See TracChangeset for help on using the changeset viewer.