/* Returns pointer to pathname pattern if matched, @filename otherwise.  */
static const struct tomoyo_path_info* tomoyo_get_file_pattern(const struct tomoyo_path_info *filename)
/* Returns pointer to pathname pattern if matched, @filename otherwise.  */
static const struct tomoyo_path_info* tomoyo_get_file_pattern(const struct tomoyo_path_info *filename)
{
	struct tomoyo_pattern_entry *ptr;
	const struct tomoyo_path_info *pattern = NULL;
	down_read(&tomoyo_pattern_list_lock);
	list_for_each_entry(ptr, &tomoyo_pattern_list, list) {
		if (ptr->is_deleted)
			continue;
		if (!tomoyo_path_matches_pattern(filename, ptr->pattern))
			continue;
		pattern = ptr->pattern;
		if (tomoyo_strendswith(pattern->name, "/\\*")) {
		} else {
			break;
		}
	}
	up_read(&tomoyo_pattern_list_lock);
	if (pattern)
		filename = pattern;
	return filename;
}