aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/sem.c
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr.bueso@hp.com>2013-07-08 19:01:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:27 -0400
commitcf9d5d78d05bca96df7618dfc3a5ee4414dcae58 (patch)
treeb03375cb8d7a2482ad659bd9b675589f427c2336 /ipc/sem.c
parent1ca7003ab41152d673d9e359632283d05294f3d6 (diff)
ipc: close open coded spin lock calls
Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/sem.c')
-rw-r--r--ipc/sem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 70480a3aa698..92ec6c69bab5 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -246,7 +246,7 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
246 * their critical section while the array lock is held. 246 * their critical section while the array lock is held.
247 */ 247 */
248 lock_array: 248 lock_array:
249 spin_lock(&sma->sem_perm.lock); 249 ipc_lock_object(&sma->sem_perm);
250 for (i = 0; i < sma->sem_nsems; i++) { 250 for (i = 0; i < sma->sem_nsems; i++) {
251 struct sem *sem = sma->sem_base + i; 251 struct sem *sem = sma->sem_base + i;
252 spin_unlock_wait(&sem->lock); 252 spin_unlock_wait(&sem->lock);
@@ -259,7 +259,7 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
259static inline void sem_unlock(struct sem_array *sma, int locknum) 259static inline void sem_unlock(struct sem_array *sma, int locknum)
260{ 260{
261 if (locknum == -1) { 261 if (locknum == -1) {
262 spin_unlock(&sma->sem_perm.lock); 262 ipc_unlock_object(&sma->sem_perm);
263 } else { 263 } else {
264 struct sem *sem = sma->sem_base + locknum; 264 struct sem *sem = sma->sem_base + locknum;
265 spin_unlock(&sem->lock); 265 spin_unlock(&sem->lock);
@@ -872,7 +872,7 @@ static void freeary(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
872 int i; 872 int i;
873 873
874 /* Free the existing undo structures for this semaphore set. */ 874 /* Free the existing undo structures for this semaphore set. */
875 assert_spin_locked(&sma->sem_perm.lock); 875 ipc_assert_locked_object(&sma->sem_perm);
876 list_for_each_entry_safe(un, tu, &sma->list_id, list_id) { 876 list_for_each_entry_safe(un, tu, &sma->list_id, list_id) {
877 list_del(&un->list_id); 877 list_del(&un->list_id);
878 spin_lock(&un->ulp->lock); 878 spin_lock(&un->ulp->lock);
@@ -1070,7 +1070,7 @@ static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum,
1070 1070
1071 curr = &sma->sem_base[semnum]; 1071 curr = &sma->sem_base[semnum];
1072 1072
1073 assert_spin_locked(&sma->sem_perm.lock); 1073 ipc_assert_locked_object(&sma->sem_perm);
1074 list_for_each_entry(un, &sma->list_id, list_id) 1074 list_for_each_entry(un, &sma->list_id, list_id)
1075 un->semadj[semnum] = 0; 1075 un->semadj[semnum] = 0;
1076 1076
@@ -1199,7 +1199,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
1199 for (i = 0; i < nsems; i++) 1199 for (i = 0; i < nsems; i++)
1200 sma->sem_base[i].semval = sem_io[i]; 1200 sma->sem_base[i].semval = sem_io[i];
1201 1201
1202 assert_spin_locked(&sma->sem_perm.lock); 1202 ipc_assert_locked_object(&sma->sem_perm);
1203 list_for_each_entry(un, &sma->list_id, list_id) { 1203 list_for_each_entry(un, &sma->list_id, list_id) {
1204 for (i = 0; i < nsems; i++) 1204 for (i = 0; i < nsems; i++)
1205 un->semadj[i] = 0; 1205 un->semadj[i] = 0;
@@ -1496,7 +1496,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
1496 new->semid = semid; 1496 new->semid = semid;
1497 assert_spin_locked(&ulp->lock); 1497 assert_spin_locked(&ulp->lock);
1498 list_add_rcu(&new->list_proc, &ulp->list_proc); 1498 list_add_rcu(&new->list_proc, &ulp->list_proc);
1499 assert_spin_locked(&sma->sem_perm.lock); 1499 ipc_assert_locked_object(&sma->sem_perm);
1500 list_add(&new->list_id, &sma->list_id); 1500 list_add(&new->list_id, &sma->list_id);
1501 un = new; 1501 un = new;
1502 1502
@@ -1833,7 +1833,7 @@ void exit_sem(struct task_struct *tsk)
1833 } 1833 }
1834 1834
1835 /* remove un from the linked lists */ 1835 /* remove un from the linked lists */
1836 assert_spin_locked(&sma->sem_perm.lock); 1836 ipc_assert_locked_object(&sma->sem_perm);
1837 list_del(&un->list_id); 1837 list_del(&un->list_id);
1838 1838
1839 spin_lock(&ulp->lock); 1839 spin_lock(&ulp->lock);