Linux Container Development
 help / color / mirror / Atom feed
From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH][V4] Add reboot_pid_ns to handle the reboot syscall
Date: Thu, 15 Dec 2011 14:00:28 -0800	[thread overview]
Message-ID: <20111215140028.e1b8a6a7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20111214191739.GA14693-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Wed, 14 Dec 2011 20:17:39 +0100
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:

> > It would be
> > better to do
> >
> > #ifdef CONFIG_PID_NS
> > extern void pidns_handle_reboot(int cmd);
> > #else
> > static inline void pidns_handle_reboot(int cmd)
> > {
> > }
> > #endif
> 
> Can't resist.
> 
> Why the kernel always prefers to do it this way, adding the ugly
> do-nothing inlines?
> 
> Isn't it better to simply call pidns_handle_reboot(cmd) under
> CONFIG_PID_NS in sys_reboot() ?
> 
> 	#ifdef CONFIG_PID_NS
> 	if (task_active_pid_ns(current) != &init_pid_ns)
> 		return reboot_pid_ns(cmd);
> 	#endif

Imagine what the code would look like if we took all the existing empty
inline stubs and replaced them with #if/#else/#endif.

  parent reply	other threads:[~2011-12-15 22:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12  0:17 [PATCH 0/1][V4] Handle reboot in a child pid namespace Daniel Lezcano
     [not found] ` <1323649064-7960-1-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-12-12  0:17   ` [PATCH][V4] Add reboot_pid_ns to handle the reboot syscall Daniel Lezcano
     [not found]     ` <1323649064-7960-2-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-12-12 23:14       ` Serge E. Hallyn
2011-12-14  0:22       ` Andrew Morton
     [not found]         ` <20111213162242.1ab3cb1a.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-12-14 19:17           ` Oleg Nesterov
     [not found]             ` <20111214191739.GA14693-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-12-15 22:00               ` Andrew Morton [this message]
2011-12-13 22:09   ` [PATCH 0/1][V4] Handle reboot in a child pid namespace Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111215140028.e1b8a6a7.akpm@linux-foundation.org \
    --to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox