aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr.bueso@hp.com>2013-09-11 17:26:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:59:39 -0400
commit3b1c4ad37741e53804ffe0a30dd01e08b2ab6241 (patch)
tree72bdaef5ae179d87eed60879c75128e2384f6aa4 /ipc
parent79ccf0f8c8e04e8b9eda6645ba0f63b0915a3075 (diff)
ipc: drop ipcctl_pre_down
Now that sem, msgque and shm, through *_down(), all use the lockless variant of ipcctl_pre_down(), go ahead and delete it. [akpm@linux-foundation.org: fix function name in kerneldoc, cleanups] Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com> Tested-by: 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/util.c24
-rw-r--r--ipc/util.h3
2 files changed, 4 insertions, 23 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 4704223bfad4..2c8a93b380ba 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -733,7 +733,7 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out)
733} 733}
734 734
735/** 735/**
736 * ipcctl_pre_down - retrieve an ipc and check permissions for some IPC_XXX cmd 736 * ipcctl_pre_down_nolock - retrieve an ipc and check permissions for some IPC_XXX cmd
737 * @ns: the ipc namespace 737 * @ns: the ipc namespace
738 * @ids: the table of ids where to look for the ipc 738 * @ids: the table of ids where to look for the ipc
739 * @id: the id of the ipc to retrieve 739 * @id: the id of the ipc to retrieve
@@ -746,29 +746,13 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out)
746 * It must be called without any lock held and 746 * It must be called without any lock held and
747 * - retrieves the ipc with the given id in the given table. 747 * - retrieves the ipc with the given id in the given table.
748 * - performs some audit and permission check, depending on the given cmd 748 * - performs some audit and permission check, depending on the given cmd
749 * - returns the ipc with the ipc lock held in case of success 749 * - returns a pointer to the ipc object or otherwise, the corresponding error.
750 * or an err-code without any lock held otherwise.
751 * 750 *
752 * Call holding the both the rw_mutex and the rcu read lock. 751 * Call holding the both the rw_mutex and the rcu read lock.
753 */ 752 */
754struct kern_ipc_perm *ipcctl_pre_down(struct ipc_namespace *ns,
755 struct ipc_ids *ids, int id, int cmd,
756 struct ipc64_perm *perm, int extra_perm)
757{
758 struct kern_ipc_perm *ipcp;
759
760 ipcp = ipcctl_pre_down_nolock(ns, ids, id, cmd, perm, extra_perm);
761 if (IS_ERR(ipcp))
762 goto out;
763
764 spin_lock(&ipcp->lock);
765out:
766 return ipcp;
767}
768
769struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, 753struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns,
770 struct ipc_ids *ids, int id, int cmd, 754 struct ipc_ids *ids, int id, int cmd,
771 struct ipc64_perm *perm, int extra_perm) 755 struct ipc64_perm *perm, int extra_perm)
772{ 756{
773 kuid_t euid; 757 kuid_t euid;
774 int err = -EPERM; 758 int err = -EPERM;
diff --git a/ipc/util.h b/ipc/util.h
index b6a6a88f3002..41a6c4d26399 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -131,9 +131,6 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out);
131struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, 131struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns,
132 struct ipc_ids *ids, int id, int cmd, 132 struct ipc_ids *ids, int id, int cmd,
133 struct ipc64_perm *perm, int extra_perm); 133 struct ipc64_perm *perm, int extra_perm);
134struct kern_ipc_perm *ipcctl_pre_down(struct ipc_namespace *ns,
135 struct ipc_ids *ids, int id, int cmd,
136 struct ipc64_perm *perm, int extra_perm);
137 134
138#ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION 135#ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION
139 /* On IA-64, we always use the "64-bit version" of the IPC structures. */ 136 /* On IA-64, we always use the "64-bit version" of the IPC structures. */