From 237ab459f12cb98eadd3fe7b85343e183a1076a4 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Sat, 12 Jun 2010 20:46:22 +0900 Subject: TOMOYO: Use callback for updating entries. Use common "struct list_head" + "bool" + "u8" structure and use common code for elements using that structure. Signed-off-by: Tetsuo Handa Signed-off-by: James Morris --- security/tomoyo/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'security/tomoyo/util.c') diff --git a/security/tomoyo/util.c b/security/tomoyo/util.c index 307793ed6075..e5931686ca33 100644 --- a/security/tomoyo/util.c +++ b/security/tomoyo/util.c @@ -911,6 +911,8 @@ bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r) if (!domain) return true; list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { + if (!ptr->is_deleted) + continue; switch (ptr->type) { u16 perm; u8 i; @@ -944,10 +946,8 @@ bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r) if (perm & (1 << i)) count++; break; - case TOMOYO_TYPE_MOUNT_ACL: - if (!container_of(ptr, struct tomoyo_mount_acl, head)-> - is_deleted) - count++; + default: + count++; } } if (count < tomoyo_profile(domain->profile)->learning-> -- cgit v1.2.3-59-g8ed1b