diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-11 12:17:45 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 18:42:13 -0800 |
commit | e16885c5ad624a6efe1b1bf764e075d75f65a788 (patch) | |
tree | de137e799ddc0a696bb288b34fade65af1708a5e /kernel/sys.c | |
parent | a9fad4cc3975573a359a92ad047f5995d8391631 (diff) | |
download | op-kernel-dev-e16885c5ad624a6efe1b1bf764e075d75f65a788.zip op-kernel-dev-e16885c5ad624a6efe1b1bf764e075d75f65a788.tar.gz |
[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>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index b6941e0..9ccf713 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; |