From cb0abe6a5b58499bd4bc1403f4987af9ead0642c Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Mon, 17 May 2010 10:08:05 +0900 Subject: TOMOYO: Use structure for passing common arguments. Use "struct tomoyo_request_info" instead of passing individual arguments. Signed-off-by: Tetsuo Handa Signed-off-by: James Morris --- security/tomoyo/common.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'security/tomoyo/common.c') diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index d82c2978b1be..34d65871096c 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -984,21 +984,6 @@ static const char *tomoyo_get_exe(void) return cp; } -/** - * tomoyo_get_msg - Get warning message. - * - * @is_enforce: Is it enforcing mode? - * - * Returns "ERROR" or "WARNING". - */ -const char *tomoyo_get_msg(const bool is_enforce) -{ - if (is_enforce) - return "ERROR"; - else - return "WARNING"; -} - /** * tomoyo_check_flags - Check mode for specified functionality. * @@ -1040,17 +1025,20 @@ bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain) /** * tomoyo_domain_quota_is_ok - Check for domain's quota. * - * @domain: Pointer to "struct tomoyo_domain_info". + * @r: Pointer to "struct tomoyo_request_info". * * Returns true if the domain is not exceeded quota, false otherwise. * * Caller holds tomoyo_read_lock(). */ -bool tomoyo_domain_quota_is_ok(struct tomoyo_domain_info * const domain) +bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r) { unsigned int count = 0; + struct tomoyo_domain_info *domain = r->domain; struct tomoyo_acl_info *ptr; + if (r->mode != TOMOYO_CONFIG_LEARNING) + return false; if (!domain) return true; list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { -- cgit v1.2.3