public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix declaration of cgroup_mm_owner_callbacks()
@ 2008-09-15 18:41 Paul Menage
  2008-09-15 18:51 ` Balbir Singh
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Menage @ 2008-09-15 18:41 UTC (permalink / raw)
  To: Pekka Enberg, Balbir Singh, Andrew Morton; +Cc: linux-kernel

Fix declaration of cgroup_mm_owner_callbacks()

The choice of real/dummy declaration for cgroup_mm_owner_callbacks()
shouldn't be based on CONFIG_MM_OWNER, but on
CONFIG_CGROUPS. Otherwise kernel/exit.c fails to compile when
something other than a cgroups controller selects CONFIG_MM_OWNER

Signed-off-by: Paul Menage <menage@google.com>

---
include/linux/cgroup.h |   15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

Index: mmowner-mmotm-2008-09-10/include/linux/cgroup.h
===================================================================
--- mmowner-mmotm-2008-09-10.orig/include/linux/cgroup.h
+++ mmowner-mmotm-2008-09-10/include/linux/cgroup.h
@@ -403,6 +403,9 @@ void cgroup_iter_end(struct cgroup *cgrp
int cgroup_scan_tasks(struct cgroup_scanner *scan);
int cgroup_attach_task(struct cgroup *, struct task_struct *);

+void cgroup_mm_owner_callbacks(struct task_struct *old,
+			       struct task_struct *new);
+
#else /* !CONFIG_CGROUPS */

static inline int cgroup_init_early(void) { return 0; }
@@ -421,15 +424,9 @@ static inline int cgroupstats_build(stru
	return -EINVAL;
}

+static inline void cgroup_mm_owner_callbacks(struct task_struct *old,
+					     struct task_struct *new) {}
+
#endif /* !CONFIG_CGROUPS */

-#ifdef CONFIG_MM_OWNER
-extern void
-cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct  
*new);
-#else /* !CONFIG_MM_OWNER */
-static inline void
-cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct  
*new)
-{
-}
-#endif /* CONFIG_MM_OWNER */
#endif /* _LINUX_CGROUP_H */


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

* Re: [PATCH] Fix declaration of cgroup_mm_owner_callbacks()
  2008-09-15 18:41 [PATCH] Fix declaration of cgroup_mm_owner_callbacks() Paul Menage
@ 2008-09-15 18:51 ` Balbir Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Balbir Singh @ 2008-09-15 18:51 UTC (permalink / raw)
  To: Paul Menage; +Cc: Pekka Enberg, Andrew Morton, linux-kernel

Paul Menage wrote:
> +static inline void cgroup_mm_owner_callbacks(struct task_struct *old,
> +                         struct task_struct *new) {}

This is confusing coding style, I'd prefer to see the implementation after the
function declaration

Looks good to me otherwise.

-- 
	Balbir

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

end of thread, other threads:[~2008-09-15 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-15 18:41 [PATCH] Fix declaration of cgroup_mm_owner_callbacks() Paul Menage
2008-09-15 18:51 ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox