summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-11 21:17:45 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 03:42:13 +0100
commite16885c5ad624a6efe1b1bf764e075d75f65a788 (patch)
treede137e799ddc0a696bb288b34fade65af1708a5e
parent[PATCH] ipmi: use CONFIG_DMI instead of CONFIG_X86 (diff)
downloadlinux-e16885c5ad624a6efe1b1bf764e075d75f65a788.tar.xz
linux-e16885c5ad624a6efe1b1bf764e075d75f65a788.zip
[PATCH] uninline capable()
Uninline capable(). Saves 2K of kernel text on a generic .config, and 1K on a tiny config. In addition it makes the use of capable more consistent between CONFIG_SECURITY and !CONFIG_SECURITY Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/sched.h13
-rw-r--r--kernel/sys.c12
2 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c4ee35dd18ae..2ae8711bfba1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1113,19 +1113,8 @@ static inline int sas_ss_flags(unsigned long sp)
}
-#ifdef CONFIG_SECURITY
-/* code is in security.c */
+/* code is in security.c or kernel/sys.c if !SECURITY */
extern int capable(int cap);
-#else
-static inline int capable(int cap)
-{
- if (cap_raised(current->cap_effective, cap)) {
- current->flags |= PF_SUPERPRIV;
- return 1;
- }
- return 0;
-}
-#endif
/*
* Routines for handling mm_structs
diff --git a/kernel/sys.c b/kernel/sys.c
index b6941e06d5d5..9ccf713491f9 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -223,6 +223,18 @@ int unregister_reboot_notifier(struct notifier_block * nb)
EXPORT_SYMBOL(unregister_reboot_notifier);
+#ifndef CONFIG_SECURITY
+int capable(int cap)
+{
+ if (cap_raised(current->cap_effective, cap)) {
+ current->flags |= PF_SUPERPRIV;
+ return 1;
+ }
+ return 0;
+}
+EXPORT_SYMBOL(capable);
+#endif
+
static int set_one_prio(struct task_struct *p, int niceval, int error)
{
int no_nice;