aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr.bueso@hp.com>2013-09-11 17:26:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:59:44 -0400
commit32a2750010981216fb788c5190fb0e646abfab30 (patch)
tree8a3d02037101eabc254f2e63836323e4373e18a2 /ipc
parent530fcd16d87cd2417c472a581ba5a1e501556c86 (diff)
ipc: drop ipc_lock_by_ptr
After previous cleanups and optimizations, this function is no longer heavily used and we don't have a good reason to keep it. Update the few remaining callers and get rid of it. Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com> Cc: Sedat Dilek <sedat.dilek@gmail.com> Cc: Rik van Riel <riel@redhat.com> Cc: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/namespace.c3
-rw-r--r--ipc/util.c6
-rw-r--r--ipc/util.h6
3 files changed, 6 insertions, 9 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index d43d9384bb2d..59451c1e214d 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -89,7 +89,8 @@ void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
89 perm = idr_find(&ids->ipcs_idr, next_id); 89 perm = idr_find(&ids->ipcs_idr, next_id);
90 if (perm == NULL) 90 if (perm == NULL)
91 continue; 91 continue;
92 ipc_lock_by_ptr(perm); 92 rcu_read_lock();
93 ipc_lock_object(perm);
93 free(ns, perm); 94 free(ns, perm);
94 total++; 95 total++;
95 } 96 }
diff --git a/ipc/util.c b/ipc/util.c
index 1ddadcf9a2ab..9f6aa30d2e0f 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -205,7 +205,8 @@ static struct kern_ipc_perm *ipc_findkey(struct ipc_ids *ids, key_t key)
205 continue; 205 continue;
206 } 206 }
207 207
208 ipc_lock_by_ptr(ipc); 208 rcu_read_lock();
209 ipc_lock_object(ipc);
209 return ipc; 210 return ipc;
210 } 211 }
211 212
@@ -838,7 +839,8 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
838 ipc = idr_find(&ids->ipcs_idr, pos); 839 ipc = idr_find(&ids->ipcs_idr, pos);
839 if (ipc != NULL) { 840 if (ipc != NULL) {
840 *new_pos = pos + 1; 841 *new_pos = pos + 1;
841 ipc_lock_by_ptr(ipc); 842 rcu_read_lock();
843 ipc_lock_object(ipc);
842 return ipc; 844 return ipc;
843 } 845 }
844 } 846 }
diff --git a/ipc/util.h b/ipc/util.h
index 0a362ffca972..14b0a2adba08 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -171,12 +171,6 @@ static inline void ipc_assert_locked_object(struct kern_ipc_perm *perm)
171 assert_spin_locked(&perm->lock); 171 assert_spin_locked(&perm->lock);
172} 172}
173 173
174static inline void ipc_lock_by_ptr(struct kern_ipc_perm *perm)
175{
176 rcu_read_lock();
177 ipc_lock_object(perm);
178}
179
180static inline void ipc_unlock(struct kern_ipc_perm *perm) 174static inline void ipc_unlock(struct kern_ipc_perm *perm)
181{ 175{
182 ipc_unlock_object(perm); 176 ipc_unlock_object(perm);