diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-02-03 06:43:06 +0900 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-02-08 14:10:20 +1100 |
commit | ea13ddbad0eb4be9cdc406cd7e0804fa4011f6e4 (patch) | |
tree | 4068bb5baad6f6819242b36a00bf395a6db7f1e1 /security/tomoyo/domain.c | |
parent | f40a70861ace69001524644473cc389543b06c3c (diff) | |
download | op-kernel-dev-ea13ddbad0eb4be9cdc406cd7e0804fa4011f6e4.zip op-kernel-dev-ea13ddbad0eb4be9cdc406cd7e0804fa4011f6e4.tar.gz |
TOMOYO: Extract bitfield
Since list elements are rounded up to kmalloc() size rather than sizeof(int),
saving one byte by using bitfields is no longer helpful.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/domain.c')
-rw-r--r-- | security/tomoyo/domain.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 3484397..ec612ae 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c @@ -130,28 +130,6 @@ struct tomoyo_alias_entry { }; /** - * tomoyo_set_domain_flag - Set or clear domain's attribute flags. - * - * @domain: Pointer to "struct tomoyo_domain_info". - * @is_delete: True if it is a delete request. - * @flags: Flags to set or clear. - * - * Returns nothing. - */ -void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain, - const bool is_delete, const u8 flags) -{ - /* We need to serialize because this is bitfield operation. */ - static DEFINE_SPINLOCK(lock); - spin_lock(&lock); - if (!is_delete) - domain->flags |= flags; - else - domain->flags &= ~flags; - spin_unlock(&lock); -} - -/** * tomoyo_get_last_name - Get last component of a domainname. * * @domain: Pointer to "struct tomoyo_domain_info". @@ -896,8 +874,7 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm) if (is_enforce) retval = -EPERM; else - tomoyo_set_domain_flag(old_domain, false, - TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED); + old_domain->transition_failed = true; out: if (!domain) domain = old_domain; |