tomoyo: use DEFINE_SRCU() to define tomoyo_ss
authorLai Jiangshan <laijs@cn.fujitsu.com>
Fri, 15 Mar 2013 16:50:53 +0000 (00:50 +0800)
committerJames Morris <james.l.morris@oracle.com>
Mon, 18 Mar 2013 12:53:00 +0000 (23:53 +1100)
DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/tomoyo/tomoyo.c

index a2ee362..f0b756e 100644 (file)
@@ -536,7 +536,7 @@ static struct security_operations tomoyo_security_ops = {
 };
 
 /* Lock for GC. */
-struct srcu_struct tomoyo_ss;
+DEFINE_SRCU(tomoyo_ss);
 
 /**
  * tomoyo_init - Register TOMOYO Linux as a LSM module.
@@ -550,8 +550,7 @@ static int __init tomoyo_init(void)
        if (!security_module_enable(&tomoyo_security_ops))
                return 0;
        /* register ourselves with the security framework */
-       if (register_security(&tomoyo_security_ops) ||
-           init_srcu_struct(&tomoyo_ss))
+       if (register_security(&tomoyo_security_ops))
                panic("Failure registering TOMOYO Linux");
        printk(KERN_INFO "TOMOYO Linux initialized\n");
        cred->security = &tomoyo_kernel_domain;