diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-02-02 16:43:06 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-02-07 22:10:20 -0500 |
commit | ea13ddbad0eb4be9cdc406cd7e0804fa4011f6e4 (patch) | |
tree | 4068bb5baad6f6819242b36a00bf395a6db7f1e1 /security/tomoyo/domain.c | |
parent | f40a70861ace69001524644473cc389543b06c3c (diff) |
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 34843971cc60..ec612ae87b51 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c | |||
@@ -130,28 +130,6 @@ struct tomoyo_alias_entry { | |||
130 | }; | 130 | }; |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * tomoyo_set_domain_flag - Set or clear domain's attribute flags. | ||
134 | * | ||
135 | * @domain: Pointer to "struct tomoyo_domain_info". | ||
136 | * @is_delete: True if it is a delete request. | ||
137 | * @flags: Flags to set or clear. | ||
138 | * | ||
139 | * Returns nothing. | ||
140 | */ | ||
141 | void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain, | ||
142 | const bool is_delete, const u8 flags) | ||
143 | { | ||
144 | /* We need to serialize because this is bitfield operation. */ | ||
145 | static DEFINE_SPINLOCK(lock); | ||
146 | spin_lock(&lock); | ||
147 | if (!is_delete) | ||
148 | domain->flags |= flags; | ||
149 | else | ||
150 | domain->flags &= ~flags; | ||
151 | spin_unlock(&lock); | ||
152 | } | ||
153 | |||
154 | /** | ||
155 | * tomoyo_get_last_name - Get last component of a domainname. | 133 | * tomoyo_get_last_name - Get last component of a domainname. |
156 | * | 134 | * |
157 | * @domain: Pointer to "struct tomoyo_domain_info". | 135 | * @domain: Pointer to "struct tomoyo_domain_info". |
@@ -896,8 +874,7 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm) | |||
896 | if (is_enforce) | 874 | if (is_enforce) |
897 | retval = -EPERM; | 875 | retval = -EPERM; |
898 | else | 876 | else |
899 | tomoyo_set_domain_flag(old_domain, false, | 877 | old_domain->transition_failed = true; |
900 | TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED); | ||
901 | out: | 878 | out: |
902 | if (!domain) | 879 | if (!domain) |
903 | domain = old_domain; | 880 | domain = old_domain; |