diff options
Diffstat (limited to 'include/linux/sem.h')
-rw-r--r-- | include/linux/sem.h | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/include/linux/sem.h b/include/linux/sem.h index 1feb2de2ee57..10d6b226afc5 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -83,13 +83,6 @@ struct seminfo { | |||
83 | 83 | ||
84 | struct task_struct; | 84 | struct task_struct; |
85 | 85 | ||
86 | /* One semaphore structure for each semaphore in the system. */ | ||
87 | struct sem { | ||
88 | int semval; /* current value */ | ||
89 | int sempid; /* pid of last operation */ | ||
90 | struct list_head sem_pending; /* pending single-sop operations */ | ||
91 | }; | ||
92 | |||
93 | /* One sem_array data structure for each set of semaphores in the system. */ | 86 | /* One sem_array data structure for each set of semaphores in the system. */ |
94 | struct sem_array { | 87 | struct sem_array { |
95 | struct kern_ipc_perm ____cacheline_aligned_in_smp | 88 | struct kern_ipc_perm ____cacheline_aligned_in_smp |
@@ -103,51 +96,21 @@ struct sem_array { | |||
103 | int complex_count; /* pending complex operations */ | 96 | int complex_count; /* pending complex operations */ |
104 | }; | 97 | }; |
105 | 98 | ||
106 | /* One queue for each sleeping process in the system. */ | 99 | #ifdef CONFIG_SYSVIPC |
107 | struct sem_queue { | ||
108 | struct list_head simple_list; /* queue of pending operations */ | ||
109 | struct list_head list; /* queue of pending operations */ | ||
110 | struct task_struct *sleeper; /* this process */ | ||
111 | struct sem_undo *undo; /* undo structure */ | ||
112 | int pid; /* process id of requesting process */ | ||
113 | int status; /* completion status of operation */ | ||
114 | struct sembuf *sops; /* array of pending operations */ | ||
115 | int nsops; /* number of operations */ | ||
116 | int alter; /* does the operation alter the array? */ | ||
117 | }; | ||
118 | |||
119 | /* Each task has a list of undo requests. They are executed automatically | ||
120 | * when the process exits. | ||
121 | */ | ||
122 | struct sem_undo { | ||
123 | struct list_head list_proc; /* per-process list: all undos from one process. */ | ||
124 | /* rcu protected */ | ||
125 | struct rcu_head rcu; /* rcu struct for sem_undo() */ | ||
126 | struct sem_undo_list *ulp; /* sem_undo_list for the process */ | ||
127 | struct list_head list_id; /* per semaphore array list: all undos for one array */ | ||
128 | int semid; /* semaphore set identifier */ | ||
129 | short * semadj; /* array of adjustments, one per semaphore */ | ||
130 | }; | ||
131 | |||
132 | /* sem_undo_list controls shared access to the list of sem_undo structures | ||
133 | * that may be shared among all a CLONE_SYSVSEM task group. | ||
134 | */ | ||
135 | struct sem_undo_list { | ||
136 | atomic_t refcnt; | ||
137 | spinlock_t lock; | ||
138 | struct list_head list_proc; | ||
139 | }; | ||
140 | 100 | ||
141 | struct sysv_sem { | 101 | struct sysv_sem { |
142 | struct sem_undo_list *undo_list; | 102 | struct sem_undo_list *undo_list; |
143 | }; | 103 | }; |
144 | 104 | ||
145 | #ifdef CONFIG_SYSVIPC | ||
146 | |||
147 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); | 105 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); |
148 | extern void exit_sem(struct task_struct *tsk); | 106 | extern void exit_sem(struct task_struct *tsk); |
149 | 107 | ||
150 | #else | 108 | #else |
109 | |||
110 | struct sysv_sem { | ||
111 | /* empty */ | ||
112 | }; | ||
113 | |||
151 | static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | 114 | static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) |
152 | { | 115 | { |
153 | return 0; | 116 | return 0; |