]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[PATCH] uninline capable()
authorIngo Molnar <mingo@elte.hu>
Wed, 11 Jan 2006 20:17:45 +0000 (12:17 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 12 Jan 2006 02:42:13 +0000 (18:42 -0800)
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>
include/linux/sched.h
kernel/sys.c

index c4ee35dd18aec3baca993e342233f5ccfda96e56..2ae8711bfba16b0060334d2bf08574b9edbbdce2 100644 (file)
@@ -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
index b6941e06d5d507a141a135294c8d29e62ddd59d3..9ccf713491f989a3f8b6442f73c765f1069e2d79 100644 (file)
@@ -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;