Commit ab588cca authored by Tetsuo Handa's avatar Tetsuo Handa Committed by James Morris

TOMOYO: Remove redundant markers.

Remove '/***** START/STOP *****/' markers.
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 850b0cee
...@@ -866,7 +866,6 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned ...@@ -866,7 +866,6 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned
if (profile >= TOMOYO_MAX_PROFILES) if (profile >= TOMOYO_MAX_PROFILES)
return NULL; return NULL;
/***** EXCLUSIVE SECTION START *****/
mutex_lock(&lock); mutex_lock(&lock);
ptr = tomoyo_profile_ptr[profile]; ptr = tomoyo_profile_ptr[profile];
if (ptr) if (ptr)
...@@ -880,7 +879,6 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned ...@@ -880,7 +879,6 @@ static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned
tomoyo_profile_ptr[profile] = ptr; tomoyo_profile_ptr[profile] = ptr;
ok: ok:
mutex_unlock(&lock); mutex_unlock(&lock);
/***** EXCLUSIVE SECTION END *****/
return ptr; return ptr;
} }
...@@ -1050,7 +1048,6 @@ static int tomoyo_update_manager_entry(const char *manager, ...@@ -1050,7 +1048,6 @@ static int tomoyo_update_manager_entry(const char *manager,
saved_manager = tomoyo_save_name(manager); saved_manager = tomoyo_save_name(manager);
if (!saved_manager) if (!saved_manager)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_policy_manager_list_lock); down_write(&tomoyo_policy_manager_list_lock);
list_for_each_entry(ptr, &tomoyo_policy_manager_list, list) { list_for_each_entry(ptr, &tomoyo_policy_manager_list, list) {
if (ptr->manager != saved_manager) if (ptr->manager != saved_manager)
...@@ -1072,7 +1069,6 @@ static int tomoyo_update_manager_entry(const char *manager, ...@@ -1072,7 +1069,6 @@ static int tomoyo_update_manager_entry(const char *manager,
error = 0; error = 0;
out: out:
up_write(&tomoyo_policy_manager_list_lock); up_write(&tomoyo_policy_manager_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -1197,13 +1193,11 @@ static bool tomoyo_is_select_one(struct tomoyo_io_buffer *head, ...@@ -1197,13 +1193,11 @@ static bool tomoyo_is_select_one(struct tomoyo_io_buffer *head,
if (sscanf(data, "pid=%u", &pid) == 1) { if (sscanf(data, "pid=%u", &pid) == 1) {
struct task_struct *p; struct task_struct *p;
/***** CRITICAL SECTION START *****/
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
p = find_task_by_vpid(pid); p = find_task_by_vpid(pid);
if (p) if (p)
domain = tomoyo_real_domain(p); domain = tomoyo_real_domain(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
/***** CRITICAL SECTION END *****/
} else if (!strncmp(data, "domain=", 7)) { } else if (!strncmp(data, "domain=", 7)) {
if (tomoyo_is_domain_def(data + 7)) { if (tomoyo_is_domain_def(data + 7)) {
down_read(&tomoyo_domain_list_lock); down_read(&tomoyo_domain_list_lock);
...@@ -1594,13 +1588,11 @@ static int tomoyo_read_pid(struct tomoyo_io_buffer *head) ...@@ -1594,13 +1588,11 @@ static int tomoyo_read_pid(struct tomoyo_io_buffer *head)
const int pid = head->read_step; const int pid = head->read_step;
struct task_struct *p; struct task_struct *p;
struct tomoyo_domain_info *domain = NULL; struct tomoyo_domain_info *domain = NULL;
/***** CRITICAL SECTION START *****/
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
p = find_task_by_vpid(pid); p = find_task_by_vpid(pid);
if (p) if (p)
domain = tomoyo_real_domain(p); domain = tomoyo_real_domain(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
/***** CRITICAL SECTION END *****/
if (domain) if (domain)
tomoyo_io_printf(head, "%d %u %s", pid, domain->profile, tomoyo_io_printf(head, "%d %u %s", pid, domain->profile,
domain->domainname->name); domain->domainname->name);
......
...@@ -67,14 +67,12 @@ void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain, ...@@ -67,14 +67,12 @@ void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain,
{ {
/* We need to serialize because this is bitfield operation. */ /* We need to serialize because this is bitfield operation. */
static DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
/***** CRITICAL SECTION START *****/
spin_lock(&lock); spin_lock(&lock);
if (!is_delete) if (!is_delete)
domain->flags |= flags; domain->flags |= flags;
else else
domain->flags &= ~flags; domain->flags &= ~flags;
spin_unlock(&lock); spin_unlock(&lock);
/***** CRITICAL SECTION END *****/
} }
/** /**
...@@ -135,7 +133,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname, ...@@ -135,7 +133,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname,
saved_program = tomoyo_save_name(program); saved_program = tomoyo_save_name(program);
if (!saved_program) if (!saved_program)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_initializer_list_lock); down_write(&tomoyo_domain_initializer_list_lock);
list_for_each_entry(ptr, &tomoyo_domain_initializer_list, list) { list_for_each_entry(ptr, &tomoyo_domain_initializer_list, list) {
if (ptr->is_not != is_not || if (ptr->is_not != is_not ||
...@@ -161,7 +158,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname, ...@@ -161,7 +158,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname,
error = 0; error = 0;
out: out:
up_write(&tomoyo_domain_initializer_list_lock); up_write(&tomoyo_domain_initializer_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -314,7 +310,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname, ...@@ -314,7 +310,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname,
saved_domainname = tomoyo_save_name(domainname); saved_domainname = tomoyo_save_name(domainname);
if (!saved_domainname) if (!saved_domainname)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_keeper_list_lock); down_write(&tomoyo_domain_keeper_list_lock);
list_for_each_entry(ptr, &tomoyo_domain_keeper_list, list) { list_for_each_entry(ptr, &tomoyo_domain_keeper_list, list) {
if (ptr->is_not != is_not || if (ptr->is_not != is_not ||
...@@ -340,7 +335,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname, ...@@ -340,7 +335,6 @@ static int tomoyo_update_domain_keeper_entry(const char *domainname,
error = 0; error = 0;
out: out:
up_write(&tomoyo_domain_keeper_list_lock); up_write(&tomoyo_domain_keeper_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -475,7 +469,6 @@ static int tomoyo_update_alias_entry(const char *original_name, ...@@ -475,7 +469,6 @@ static int tomoyo_update_alias_entry(const char *original_name,
saved_aliased_name = tomoyo_save_name(aliased_name); saved_aliased_name = tomoyo_save_name(aliased_name);
if (!saved_original_name || !saved_aliased_name) if (!saved_original_name || !saved_aliased_name)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_alias_list_lock); down_write(&tomoyo_alias_list_lock);
list_for_each_entry(ptr, &tomoyo_alias_list, list) { list_for_each_entry(ptr, &tomoyo_alias_list, list) {
if (ptr->original_name != saved_original_name || if (ptr->original_name != saved_original_name ||
...@@ -498,7 +491,6 @@ static int tomoyo_update_alias_entry(const char *original_name, ...@@ -498,7 +491,6 @@ static int tomoyo_update_alias_entry(const char *original_name,
error = 0; error = 0;
out: out:
up_write(&tomoyo_alias_list_lock); up_write(&tomoyo_alias_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -566,7 +558,6 @@ int tomoyo_delete_domain(char *domainname) ...@@ -566,7 +558,6 @@ int tomoyo_delete_domain(char *domainname)
name.name = domainname; name.name = domainname;
tomoyo_fill_path_info(&name); tomoyo_fill_path_info(&name);
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_list_lock); down_write(&tomoyo_domain_list_lock);
/* Is there an active domain? */ /* Is there an active domain? */
list_for_each_entry(domain, &tomoyo_domain_list, list) { list_for_each_entry(domain, &tomoyo_domain_list, list) {
...@@ -580,7 +571,6 @@ int tomoyo_delete_domain(char *domainname) ...@@ -580,7 +571,6 @@ int tomoyo_delete_domain(char *domainname)
break; break;
} }
up_write(&tomoyo_domain_list_lock); up_write(&tomoyo_domain_list_lock);
/***** EXCLUSIVE SECTION END *****/
return 0; return 0;
} }
...@@ -599,7 +589,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * ...@@ -599,7 +589,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char *
struct tomoyo_domain_info *domain = NULL; struct tomoyo_domain_info *domain = NULL;
const struct tomoyo_path_info *saved_domainname; const struct tomoyo_path_info *saved_domainname;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_list_lock); down_write(&tomoyo_domain_list_lock);
domain = tomoyo_find_domain(domainname); domain = tomoyo_find_domain(domainname);
if (domain) if (domain)
...@@ -618,7 +607,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * ...@@ -618,7 +607,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char *
domain->domainname != saved_domainname) domain->domainname != saved_domainname)
continue; continue;
flag = false; flag = false;
/***** CRITICAL SECTION START *****/
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
for_each_process(p) { for_each_process(p) {
if (tomoyo_real_domain(p) != domain) if (tomoyo_real_domain(p) != domain)
...@@ -627,7 +615,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * ...@@ -627,7 +615,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char *
break; break;
} }
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
/***** CRITICAL SECTION END *****/
if (flag) if (flag)
continue; continue;
list_for_each_entry(ptr, &domain->acl_info_list, list) { list_for_each_entry(ptr, &domain->acl_info_list, list) {
...@@ -650,7 +637,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char * ...@@ -650,7 +637,6 @@ struct tomoyo_domain_info *tomoyo_find_or_assign_new_domain(const char *
} }
out: out:
up_write(&tomoyo_domain_list_lock); up_write(&tomoyo_domain_list_lock);
/***** EXCLUSIVE SECTION END *****/
return domain; return domain;
} }
......
...@@ -166,7 +166,6 @@ static int tomoyo_update_globally_readable_entry(const char *filename, ...@@ -166,7 +166,6 @@ static int tomoyo_update_globally_readable_entry(const char *filename,
saved_filename = tomoyo_save_name(filename); saved_filename = tomoyo_save_name(filename);
if (!saved_filename) if (!saved_filename)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_globally_readable_list_lock); down_write(&tomoyo_globally_readable_list_lock);
list_for_each_entry(ptr, &tomoyo_globally_readable_list, list) { list_for_each_entry(ptr, &tomoyo_globally_readable_list, list) {
if (ptr->filename != saved_filename) if (ptr->filename != saved_filename)
...@@ -187,7 +186,6 @@ static int tomoyo_update_globally_readable_entry(const char *filename, ...@@ -187,7 +186,6 @@ static int tomoyo_update_globally_readable_entry(const char *filename,
error = 0; error = 0;
out: out:
up_write(&tomoyo_globally_readable_list_lock); up_write(&tomoyo_globally_readable_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -284,7 +282,6 @@ static int tomoyo_update_file_pattern_entry(const char *pattern, ...@@ -284,7 +282,6 @@ static int tomoyo_update_file_pattern_entry(const char *pattern,
saved_pattern = tomoyo_save_name(pattern); saved_pattern = tomoyo_save_name(pattern);
if (!saved_pattern) if (!saved_pattern)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_pattern_list_lock); down_write(&tomoyo_pattern_list_lock);
list_for_each_entry(ptr, &tomoyo_pattern_list, list) { list_for_each_entry(ptr, &tomoyo_pattern_list, list) {
if (saved_pattern != ptr->pattern) if (saved_pattern != ptr->pattern)
...@@ -305,7 +302,6 @@ static int tomoyo_update_file_pattern_entry(const char *pattern, ...@@ -305,7 +302,6 @@ static int tomoyo_update_file_pattern_entry(const char *pattern,
error = 0; error = 0;
out: out:
up_write(&tomoyo_pattern_list_lock); up_write(&tomoyo_pattern_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -407,7 +403,6 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern, ...@@ -407,7 +403,6 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern,
saved_pattern = tomoyo_save_name(pattern); saved_pattern = tomoyo_save_name(pattern);
if (!saved_pattern) if (!saved_pattern)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_no_rewrite_list_lock); down_write(&tomoyo_no_rewrite_list_lock);
list_for_each_entry(ptr, &tomoyo_no_rewrite_list, list) { list_for_each_entry(ptr, &tomoyo_no_rewrite_list, list) {
if (ptr->pattern != saved_pattern) if (ptr->pattern != saved_pattern)
...@@ -428,7 +423,6 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern, ...@@ -428,7 +423,6 @@ static int tomoyo_update_no_rewrite_entry(const char *pattern,
error = 0; error = 0;
out: out:
up_write(&tomoyo_no_rewrite_list_lock); up_write(&tomoyo_no_rewrite_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -745,7 +739,6 @@ static int tomoyo_update_single_path_acl(const u8 type, const char *filename, ...@@ -745,7 +739,6 @@ static int tomoyo_update_single_path_acl(const u8 type, const char *filename,
saved_filename = tomoyo_save_name(filename); saved_filename = tomoyo_save_name(filename);
if (!saved_filename) if (!saved_filename)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_acl_info_list_lock); down_write(&tomoyo_domain_acl_info_list_lock);
if (is_delete) if (is_delete)
goto delete; goto delete;
...@@ -800,7 +793,6 @@ static int tomoyo_update_single_path_acl(const u8 type, const char *filename, ...@@ -800,7 +793,6 @@ static int tomoyo_update_single_path_acl(const u8 type, const char *filename,
} }
out: out:
up_write(&tomoyo_domain_acl_info_list_lock); up_write(&tomoyo_domain_acl_info_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
...@@ -836,7 +828,6 @@ static int tomoyo_update_double_path_acl(const u8 type, const char *filename1, ...@@ -836,7 +828,6 @@ static int tomoyo_update_double_path_acl(const u8 type, const char *filename1,
saved_filename2 = tomoyo_save_name(filename2); saved_filename2 = tomoyo_save_name(filename2);
if (!saved_filename1 || !saved_filename2) if (!saved_filename1 || !saved_filename2)
return -ENOMEM; return -ENOMEM;
/***** EXCLUSIVE SECTION START *****/
down_write(&tomoyo_domain_acl_info_list_lock); down_write(&tomoyo_domain_acl_info_list_lock);
if (is_delete) if (is_delete)
goto delete; goto delete;
...@@ -884,7 +875,6 @@ static int tomoyo_update_double_path_acl(const u8 type, const char *filename1, ...@@ -884,7 +875,6 @@ static int tomoyo_update_double_path_acl(const u8 type, const char *filename1,
} }
out: out:
up_write(&tomoyo_domain_acl_info_list_lock); up_write(&tomoyo_domain_acl_info_list_lock);
/***** EXCLUSIVE SECTION END *****/
return error; return error;
} }
......
...@@ -220,7 +220,6 @@ void *tomoyo_alloc_element(const unsigned int size) ...@@ -220,7 +220,6 @@ void *tomoyo_alloc_element(const unsigned int size)
= roundup(size, max(sizeof(void *), sizeof(long))); = roundup(size, max(sizeof(void *), sizeof(long)));
if (word_aligned_size > PATH_MAX) if (word_aligned_size > PATH_MAX)
return NULL; return NULL;
/***** EXCLUSIVE SECTION START *****/
mutex_lock(&lock); mutex_lock(&lock);
if (buf_used_len + word_aligned_size > PATH_MAX) { if (buf_used_len + word_aligned_size > PATH_MAX) {
if (!tomoyo_quota_for_elements || if (!tomoyo_quota_for_elements ||
...@@ -251,7 +250,6 @@ void *tomoyo_alloc_element(const unsigned int size) ...@@ -251,7 +250,6 @@ void *tomoyo_alloc_element(const unsigned int size)
} }
} }
mutex_unlock(&lock); mutex_unlock(&lock);
/***** EXCLUSIVE SECTION END *****/
return ptr; return ptr;
} }
...@@ -318,7 +316,6 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name) ...@@ -318,7 +316,6 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
return NULL; return NULL;
} }
hash = full_name_hash((const unsigned char *) name, len - 1); hash = full_name_hash((const unsigned char *) name, len - 1);
/***** EXCLUSIVE SECTION START *****/
mutex_lock(&lock); mutex_lock(&lock);
list_for_each_entry(ptr, &tomoyo_name_list[hash % TOMOYO_MAX_HASH], list_for_each_entry(ptr, &tomoyo_name_list[hash % TOMOYO_MAX_HASH],
list) { list) {
...@@ -366,7 +363,6 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name) ...@@ -366,7 +363,6 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
} }
out: out:
mutex_unlock(&lock); mutex_unlock(&lock);
/***** EXCLUSIVE SECTION END *****/
return ptr ? &ptr->entry : NULL; return ptr ? &ptr->entry : NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment