linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/30] ipcns: remove useless get/put while CLONE_NEWIPC
@ 2009-04-10  2:33 Alexey Dobriyan
  2009-04-10 15:19 ` Serge E. Hallyn
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2009-04-10  2:33 UTC (permalink / raw)
  To: akpm, containers
  Cc: xemul, serue, dave, mingo, orenl, hch, torvalds, linux-kernel

copy_ipcs() doesn't actually copy anything. If new ipcns is created,
it's created from scratch, in this case get/put on old ipcns isn't needed.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 ipc/namespace.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -50,15 +50,11 @@ struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns)
 {
 	struct ipc_namespace *new_ns;
 
-	BUG_ON(!ns);
-	get_ipc_ns(ns);
-
 	if (!(flags & CLONE_NEWIPC))
-		return ns;
+		return get_ipc_ns(ns);
 
 	new_ns = clone_ipc_ns(ns);
 
-	put_ipc_ns(ns);
 	return new_ns;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-10 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-10  2:33 [PATCH 03/30] ipcns: remove useless get/put while CLONE_NEWIPC Alexey Dobriyan
2009-04-10 15:19 ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).