1 #ifndef __VFS_TLL_H__ 2 #define __VFS_TLL_H__ 3 4 /* Three-level-lock. Allows read-only, read-serialized, and write-only locks */ 5 6 typedef enum { TLL_NONE, TLL_READ, TLL_READSER, TLL_WRITE } tll_access_t; 7 typedef enum { TLL_DFLT = 0x0, TLL_UPGR = 0x1, TLL_PEND = 0x2 } tll_status_t; 8 9 typedef struct { 10 tll_access_t t_current; /* Current type of access to lock */ 11 struct worker_thread *t_owner;/* Owner of non-read-only lock */ 12 signed int t_readonly; /* No. of current read-only access */ 13 tll_status_t t_status; /* Lock status; nothing, pending upgrade, or 14 * pending upgrade of read-serialized to 15 * write-only */ 16 struct worker_thread *t_write;/* Write/read-only access requestors queue */ 17 struct worker_thread *t_serial;/* Read-serialized access requestors queue */ 18 } tll_t; 19 20 #endif 21