netlink: revert broken, broken "2-clause nla_ok()"
[linux-2.6/btrfs-unstable.git] / include / linux / sem.h
blobd0efd6e6c20a6a6a39273639dbd33f3d77c2e156
1 #ifndef _LINUX_SEM_H
2 #define _LINUX_SEM_H
4 #include <linux/atomic.h>
5 #include <linux/rcupdate.h>
6 #include <linux/cache.h>
7 #include <uapi/linux/sem.h>
9 struct task_struct;
11 /* One sem_array data structure for each set of semaphores in the system. */
12 struct sem_array {
13 struct kern_ipc_perm ____cacheline_aligned_in_smp
14 sem_perm; /* permissions .. see ipc.h */
15 time_t sem_ctime; /* last change time */
16 struct sem *sem_base; /* ptr to first semaphore in array */
17 struct list_head pending_alter; /* pending operations */
18 /* that alter the array */
19 struct list_head pending_const; /* pending complex operations */
20 /* that do not alter semvals */
21 struct list_head list_id; /* undo requests on this array */
22 int sem_nsems; /* no. of semaphores in array */
23 int complex_count; /* pending complex operations */
24 bool complex_mode; /* no parallel simple ops */
27 #ifdef CONFIG_SYSVIPC
29 struct sysv_sem {
30 struct sem_undo_list *undo_list;
33 extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
34 extern void exit_sem(struct task_struct *tsk);
36 #else
38 struct sysv_sem {
39 /* empty */
42 static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
44 return 0;
47 static inline void exit_sem(struct task_struct *tsk)
49 return;
51 #endif
53 #endif /* _LINUX_SEM_H */