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 <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
diff --git a/security/tomoyo/util.c b/security/tomoyo/util.c
index 307793e..e593168 100644
--- a/security/tomoyo/util.c
+++ b/security/tomoyo/util.c
@@ -911,6 +911,8 @@
 	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 @@
 				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->