提交 505f14f7 编写于 作者: L Lai Jiangshan 提交者: James Morris

tomoyo: use DEFINE_SRCU() to define tomoyo_ss

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.
Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: NJames Morris <james.l.morris@oracle.com>
上级 2c4cdf59
...@@ -536,7 +536,7 @@ static struct security_operations tomoyo_security_ops = { ...@@ -536,7 +536,7 @@ static struct security_operations tomoyo_security_ops = {
}; };
/* Lock for GC. */ /* Lock for GC. */
struct srcu_struct tomoyo_ss; DEFINE_SRCU(tomoyo_ss);
/** /**
* tomoyo_init - Register TOMOYO Linux as a LSM module. * tomoyo_init - Register TOMOYO Linux as a LSM module.
...@@ -550,8 +550,7 @@ static int __init tomoyo_init(void) ...@@ -550,8 +550,7 @@ static int __init tomoyo_init(void)
if (!security_module_enable(&tomoyo_security_ops)) if (!security_module_enable(&tomoyo_security_ops))
return 0; return 0;
/* register ourselves with the security framework */ /* register ourselves with the security framework */
if (register_security(&tomoyo_security_ops) || if (register_security(&tomoyo_security_ops))
init_srcu_struct(&tomoyo_ss))
panic("Failure registering TOMOYO Linux"); panic("Failure registering TOMOYO Linux");
printk(KERN_INFO "TOMOYO Linux initialized\n"); printk(KERN_INFO "TOMOYO Linux initialized\n");
cred->security = &tomoyo_kernel_domain; cred->security = &tomoyo_kernel_domain;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册