aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sem.h')
-rw-r--r--include/linux/sem.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/sem.h b/include/linux/sem.h
index c8eaad9e4b72..1b191c176bcd 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -78,6 +78,7 @@ struct seminfo {
78 78
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h> 80#include <asm/atomic.h>
81#include <linux/rcupdate.h>
81 82
82struct task_struct; 83struct task_struct;
83 84
@@ -93,23 +94,19 @@ struct sem_array {
93 time_t sem_otime; /* last semop time */ 94 time_t sem_otime; /* last semop time */
94 time_t sem_ctime; /* last change time */ 95 time_t sem_ctime; /* last change time */
95 struct sem *sem_base; /* ptr to first semaphore in array */ 96 struct sem *sem_base; /* ptr to first semaphore in array */
96 struct sem_queue *sem_pending; /* pending operations to be processed */ 97 struct list_head sem_pending; /* pending operations to be processed */
97 struct sem_queue **sem_pending_last; /* last pending operation */ 98 struct list_head list_id; /* undo requests on this array */
98 struct sem_undo *undo; /* undo requests on this array */
99 unsigned long sem_nsems; /* no. of semaphores in array */ 99 unsigned long sem_nsems; /* no. of semaphores in array */
100}; 100};
101 101
102/* One queue for each sleeping process in the system. */ 102/* One queue for each sleeping process in the system. */
103struct sem_queue { 103struct sem_queue {
104 struct sem_queue * next; /* next entry in the queue */ 104 struct list_head list; /* queue of pending operations */
105 struct sem_queue ** prev; /* previous entry in the queue, *(q->prev) == q */ 105 struct task_struct *sleeper; /* this process */
106 struct task_struct* sleeper; /* this process */ 106 struct sem_undo *undo; /* undo structure */
107 struct sem_undo * undo; /* undo structure */
108 int pid; /* process id of requesting process */ 107 int pid; /* process id of requesting process */
109 int status; /* completion status of operation */ 108 int status; /* completion status of operation */
110 struct sem_array * sma; /* semaphore array for operations */ 109 struct sembuf *sops; /* array of pending operations */
111 int id; /* internal sem id */
112 struct sembuf * sops; /* array of pending operations */
113 int nsops; /* number of operations */ 110 int nsops; /* number of operations */
114 int alter; /* does the operation alter the array? */ 111 int alter; /* does the operation alter the array? */
115}; 112};
@@ -118,8 +115,11 @@ struct sem_queue {
118 * when the process exits. 115 * when the process exits.
119 */ 116 */
120struct sem_undo { 117struct sem_undo {
121 struct sem_undo * proc_next; /* next entry on this process */ 118 struct list_head list_proc; /* per-process list: all undos from one process. */
122 struct sem_undo * id_next; /* next entry on this semaphore set */ 119 /* rcu protected */
120 struct rcu_head rcu; /* rcu struct for sem_undo() */
121 struct sem_undo_list *ulp; /* sem_undo_list for the process */
122 struct list_head list_id; /* per semaphore array list: all undos for one array */
123 int semid; /* semaphore set identifier */ 123 int semid; /* semaphore set identifier */
124 short * semadj; /* array of adjustments, one per semaphore */ 124 short * semadj; /* array of adjustments, one per semaphore */
125}; 125};
@@ -128,9 +128,9 @@ struct sem_undo {
128 * that may be shared among all a CLONE_SYSVSEM task group. 128 * that may be shared among all a CLONE_SYSVSEM task group.
129 */ 129 */
130struct sem_undo_list { 130struct sem_undo_list {
131 atomic_t refcnt; 131 atomic_t refcnt;
132 spinlock_t lock; 132 spinlock_t lock;
133 struct sem_undo *proc_list; 133 struct list_head list_proc;
134}; 134};
135 135
136struct sysv_sem { 136struct sysv_sem {