aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-02-02 16:43:06 -0500
committerJames Morris <jmorris@namei.org>2010-02-07 22:10:20 -0500
commitea13ddbad0eb4be9cdc406cd7e0804fa4011f6e4 (patch)
tree4068bb5baad6f6819242b36a00bf395a6db7f1e1 /security/tomoyo/common.c
parentf40a70861ace69001524644473cc389543b06c3c (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/common.c')
-rw-r--r--security/tomoyo/common.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index ef6622300a81..ae3ed7313ee0 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -842,9 +842,7 @@ bool tomoyo_domain_quota_is_ok(struct tomoyo_domain_info * const domain)
842 if (!domain) 842 if (!domain)
843 return true; 843 return true;
844 list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { 844 list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) {
845 if (ptr->type & TOMOYO_ACL_DELETED) 845 switch (ptr->type) {
846 continue;
847 switch (tomoyo_acl_type2(ptr)) {
848 struct tomoyo_single_path_acl_record *acl; 846 struct tomoyo_single_path_acl_record *acl;
849 u32 perm; 847 u32 perm;
850 u8 i; 848 u8 i;
@@ -1384,8 +1382,7 @@ static int tomoyo_write_domain_policy(struct tomoyo_io_buffer *head)
1384 return 0; 1382 return 0;
1385 } 1383 }
1386 if (!strcmp(data, TOMOYO_KEYWORD_IGNORE_GLOBAL_ALLOW_READ)) { 1384 if (!strcmp(data, TOMOYO_KEYWORD_IGNORE_GLOBAL_ALLOW_READ)) {
1387 tomoyo_set_domain_flag(domain, is_delete, 1385 domain->ignore_global_allow_read = !is_delete;
1388 TOMOYO_DOMAIN_FLAGS_IGNORE_GLOBAL_ALLOW_READ);
1389 return 0; 1386 return 0;
1390 } 1387 }
1391 return tomoyo_write_file_policy(data, domain, is_delete); 1388 return tomoyo_write_file_policy(data, domain, is_delete);
@@ -1486,10 +1483,8 @@ static bool tomoyo_print_double_path_acl(struct tomoyo_io_buffer *head,
1486static bool tomoyo_print_entry(struct tomoyo_io_buffer *head, 1483static bool tomoyo_print_entry(struct tomoyo_io_buffer *head,
1487 struct tomoyo_acl_info *ptr) 1484 struct tomoyo_acl_info *ptr)
1488{ 1485{
1489 const u8 acl_type = tomoyo_acl_type2(ptr); 1486 const u8 acl_type = ptr->type;
1490 1487
1491 if (acl_type & TOMOYO_ACL_DELETED)
1492 return true;
1493 if (acl_type == TOMOYO_TYPE_SINGLE_PATH_ACL) { 1488 if (acl_type == TOMOYO_TYPE_SINGLE_PATH_ACL) {
1494 struct tomoyo_single_path_acl_record *acl 1489 struct tomoyo_single_path_acl_record *acl
1495 = container_of(ptr, 1490 = container_of(ptr,
@@ -1540,10 +1535,9 @@ static int tomoyo_read_domain_policy(struct tomoyo_io_buffer *head)
1540 /* Print domainname and flags. */ 1535 /* Print domainname and flags. */
1541 if (domain->quota_warned) 1536 if (domain->quota_warned)
1542 quota_exceeded = "quota_exceeded\n"; 1537 quota_exceeded = "quota_exceeded\n";
1543 if (domain->flags & TOMOYO_DOMAIN_FLAGS_TRANSITION_FAILED) 1538 if (domain->transition_failed)
1544 transition_failed = "transition_failed\n"; 1539 transition_failed = "transition_failed\n";
1545 if (domain->flags & 1540 if (domain->ignore_global_allow_read)
1546 TOMOYO_DOMAIN_FLAGS_IGNORE_GLOBAL_ALLOW_READ)
1547 ignore_global_allow_read 1541 ignore_global_allow_read
1548 = TOMOYO_KEYWORD_IGNORE_GLOBAL_ALLOW_READ "\n"; 1542 = TOMOYO_KEYWORD_IGNORE_GLOBAL_ALLOW_READ "\n";
1549 done = tomoyo_io_printf(head, "%s\n" TOMOYO_KEYWORD_USE_PROFILE 1543 done = tomoyo_io_printf(head, "%s\n" TOMOYO_KEYWORD_USE_PROFILE