diff options
author | Manfred Spraul <manfred@colorfullife.com> | 2011-11-02 16:38:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-02 19:07:01 -0400 |
commit | e57940d719e9fc5223d133b631f8cb5232d6064e (patch) | |
tree | f4dfe100c571e245c7db90c446c548b9bf33b9e7 | |
parent | 0b0577f6080c0645b079dcc03fdbaf40d928beb8 (diff) |
ipc/sem.c: remove private structures from public header file
include/linux/sem.h contains several structures that are only used within
ipc/sem.c.
The patch moves them into ipc/sem.c - there is no need to expose the
structures to the whole kernel.
No functional changes, only whitespace cleanups and 80-char per line
fixes.
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/sem.h | 42 | ||||
-rw-r--r-- | ipc/sem.c | 46 |
2 files changed, 46 insertions, 42 deletions
diff --git a/include/linux/sem.h b/include/linux/sem.h index 1feb2de2ee57..464842621a4a 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,41 +96,6 @@ 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. */ | ||
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 | |||
141 | struct sysv_sem { | 99 | struct sysv_sem { |
142 | struct sem_undo_list *undo_list; | 100 | struct sem_undo_list *undo_list; |
143 | }; | 101 | }; |
@@ -90,6 +90,52 @@ | |||
90 | #include <asm/uaccess.h> | 90 | #include <asm/uaccess.h> |
91 | #include "util.h" | 91 | #include "util.h" |
92 | 92 | ||
93 | /* One semaphore structure for each semaphore in the system. */ | ||
94 | struct sem { | ||
95 | int semval; /* current value */ | ||
96 | int sempid; /* pid of last operation */ | ||
97 | struct list_head sem_pending; /* pending single-sop operations */ | ||
98 | }; | ||
99 | |||
100 | /* One queue for each sleeping process in the system. */ | ||
101 | struct sem_queue { | ||
102 | struct list_head simple_list; /* queue of pending operations */ | ||
103 | struct list_head list; /* queue of pending operations */ | ||
104 | struct task_struct *sleeper; /* this process */ | ||
105 | struct sem_undo *undo; /* undo structure */ | ||
106 | int pid; /* process id of requesting process */ | ||
107 | int status; /* completion status of operation */ | ||
108 | struct sembuf *sops; /* array of pending operations */ | ||
109 | int nsops; /* number of operations */ | ||
110 | int alter; /* does *sops alter the array? */ | ||
111 | }; | ||
112 | |||
113 | /* Each task has a list of undo requests. They are executed automatically | ||
114 | * when the process exits. | ||
115 | */ | ||
116 | struct sem_undo { | ||
117 | struct list_head list_proc; /* per-process list: * | ||
118 | * all undos from one process | ||
119 | * rcu protected */ | ||
120 | struct rcu_head rcu; /* rcu struct for sem_undo */ | ||
121 | struct sem_undo_list *ulp; /* back ptr to sem_undo_list */ | ||
122 | struct list_head list_id; /* per semaphore array list: | ||
123 | * all undos for one array */ | ||
124 | int semid; /* semaphore set identifier */ | ||
125 | short *semadj; /* array of adjustments */ | ||
126 | /* one per semaphore */ | ||
127 | }; | ||
128 | |||
129 | /* sem_undo_list controls shared access to the list of sem_undo structures | ||
130 | * that may be shared among all a CLONE_SYSVSEM task group. | ||
131 | */ | ||
132 | struct sem_undo_list { | ||
133 | atomic_t refcnt; | ||
134 | spinlock_t lock; | ||
135 | struct list_head list_proc; | ||
136 | }; | ||
137 | |||
138 | |||
93 | #define sem_ids(ns) ((ns)->ids[IPC_SEM_IDS]) | 139 | #define sem_ids(ns) ((ns)->ids[IPC_SEM_IDS]) |
94 | 140 | ||
95 | #define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm) | 141 | #define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm) |