diff options
-rw-r--r-- | ipc/msg.c | 2 | ||||
-rw-r--r-- | ipc/sem.c | 14 | ||||
-rw-r--r-- | ipc/shm.c | 4 | ||||
-rw-r--r-- | ipc/util.h | 4 |
4 files changed, 12 insertions, 12 deletions
@@ -216,7 +216,7 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) | |||
216 | INIT_LIST_HEAD(&msq->q_receivers); | 216 | INIT_LIST_HEAD(&msq->q_receivers); |
217 | INIT_LIST_HEAD(&msq->q_senders); | 217 | INIT_LIST_HEAD(&msq->q_senders); |
218 | 218 | ||
219 | spin_unlock(&msq->q_perm.lock); | 219 | ipc_unlock_object(&msq->q_perm); |
220 | rcu_read_unlock(); | 220 | rcu_read_unlock(); |
221 | 221 | ||
222 | return msq->q_perm.id; | 222 | return msq->q_perm.id; |
@@ -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, | |||
259 | static inline void sem_unlock(struct sem_array *sma, int locknum) | 259 | static 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); |
@@ -141,7 +141,7 @@ static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id) | |||
141 | static inline void shm_lock_by_ptr(struct shmid_kernel *ipcp) | 141 | static inline void shm_lock_by_ptr(struct shmid_kernel *ipcp) |
142 | { | 142 | { |
143 | rcu_read_lock(); | 143 | rcu_read_lock(); |
144 | spin_lock(&ipcp->shm_perm.lock); | 144 | ipc_lock_object(&ipcp->shm_perm); |
145 | } | 145 | } |
146 | 146 | ||
147 | static inline struct shmid_kernel *shm_lock_check(struct ipc_namespace *ns, | 147 | static inline struct shmid_kernel *shm_lock_check(struct ipc_namespace *ns, |
@@ -545,7 +545,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
545 | ns->shm_tot += numpages; | 545 | ns->shm_tot += numpages; |
546 | error = shp->shm_perm.id; | 546 | error = shp->shm_perm.id; |
547 | 547 | ||
548 | spin_unlock(&shp->shm_perm.lock); | 548 | ipc_unlock_object(&shp->shm_perm); |
549 | rcu_read_unlock(); | 549 | rcu_read_unlock(); |
550 | return error; | 550 | return error; |
551 | 551 | ||
diff --git a/ipc/util.h b/ipc/util.h index da65e8afb8f4..b6a6a88f3002 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -177,12 +177,12 @@ static inline void ipc_assert_locked_object(struct kern_ipc_perm *perm) | |||
177 | static inline void ipc_lock_by_ptr(struct kern_ipc_perm *perm) | 177 | static inline void ipc_lock_by_ptr(struct kern_ipc_perm *perm) |
178 | { | 178 | { |
179 | rcu_read_lock(); | 179 | rcu_read_lock(); |
180 | spin_lock(&perm->lock); | 180 | ipc_lock_object(perm); |
181 | } | 181 | } |
182 | 182 | ||
183 | static inline void ipc_unlock(struct kern_ipc_perm *perm) | 183 | static inline void ipc_unlock(struct kern_ipc_perm *perm) |
184 | { | 184 | { |
185 | spin_unlock(&perm->lock); | 185 | ipc_unlock_object(perm); |
186 | rcu_read_unlock(); | 186 | rcu_read_unlock(); |
187 | } | 187 | } |
188 | 188 | ||