Lines Matching refs:profile
252 struct aa_profile *profile = aa_get_profile_rcu(&r->profile); in aa_fs_seq_profname_show() local
253 seq_printf(seq, "%s\n", profile->base.name); in aa_fs_seq_profname_show()
254 aa_put_profile(profile); in aa_fs_seq_profname_show()
275 struct aa_profile *profile = aa_get_profile_rcu(&r->profile); in aa_fs_seq_profmode_show() local
276 seq_printf(seq, "%s\n", aa_profile_mode_names[profile->mode]); in aa_fs_seq_profmode_show()
277 aa_put_profile(profile); in aa_fs_seq_profmode_show()
298 struct aa_profile *profile = aa_get_profile_rcu(&r->profile); in aa_fs_seq_profattach_show() local
299 if (profile->attach) in aa_fs_seq_profattach_show()
300 seq_printf(seq, "%s\n", profile->attach); in aa_fs_seq_profattach_show()
301 else if (profile->xmatch) in aa_fs_seq_profattach_show()
304 seq_printf(seq, "%s\n", profile->base.name); in aa_fs_seq_profattach_show()
305 aa_put_profile(profile); in aa_fs_seq_profattach_show()
326 struct aa_profile *profile = aa_get_profile_rcu(&r->profile); in aa_fs_seq_hash_show() local
329 if (profile->hash) { in aa_fs_seq_hash_show()
331 seq_printf(seq, "%.2x", profile->hash[i]); in aa_fs_seq_hash_show()
352 void __aa_fs_profile_rmdir(struct aa_profile *profile) in __aa_fs_profile_rmdir() argument
357 if (!profile) in __aa_fs_profile_rmdir()
360 list_for_each_entry(child, &profile->base.profiles, base.list) in __aa_fs_profile_rmdir()
365 if (!profile->dents[i]) in __aa_fs_profile_rmdir()
368 r = d_inode(profile->dents[i])->i_private; in __aa_fs_profile_rmdir()
369 securityfs_remove(profile->dents[i]); in __aa_fs_profile_rmdir()
371 profile->dents[i] = NULL; in __aa_fs_profile_rmdir()
387 struct aa_profile *profile, in create_profile_file() argument
390 struct aa_replacedby *r = aa_get_replacedby(profile->replacedby); in create_profile_file()
401 int __aa_fs_profile_mkdir(struct aa_profile *profile, struct dentry *parent) in __aa_fs_profile_mkdir() argument
409 p = aa_deref_parent(profile); in __aa_fs_profile_mkdir()
418 if (!profile->dirname) { in __aa_fs_profile_mkdir()
420 len = mangle_name(profile->base.name, NULL); in __aa_fs_profile_mkdir()
421 id_len = snprintf(NULL, 0, ".%ld", profile->ns->uniq_id); in __aa_fs_profile_mkdir()
423 profile->dirname = kmalloc(len + id_len + 1, GFP_KERNEL); in __aa_fs_profile_mkdir()
424 if (!profile->dirname) in __aa_fs_profile_mkdir()
427 mangle_name(profile->base.name, profile->dirname); in __aa_fs_profile_mkdir()
428 sprintf(profile->dirname + len, ".%ld", profile->ns->uniq_id++); in __aa_fs_profile_mkdir()
431 dent = securityfs_create_dir(profile->dirname, parent); in __aa_fs_profile_mkdir()
434 prof_dir(profile) = dir = dent; in __aa_fs_profile_mkdir()
436 dent = create_profile_file(dir, "name", profile, &aa_fs_profname_fops); in __aa_fs_profile_mkdir()
439 profile->dents[AAFS_PROF_NAME] = dent; in __aa_fs_profile_mkdir()
441 dent = create_profile_file(dir, "mode", profile, &aa_fs_profmode_fops); in __aa_fs_profile_mkdir()
444 profile->dents[AAFS_PROF_MODE] = dent; in __aa_fs_profile_mkdir()
446 dent = create_profile_file(dir, "attach", profile, in __aa_fs_profile_mkdir()
450 profile->dents[AAFS_PROF_ATTACH] = dent; in __aa_fs_profile_mkdir()
452 if (profile->hash) { in __aa_fs_profile_mkdir()
453 dent = create_profile_file(dir, "sha1", profile, in __aa_fs_profile_mkdir()
457 profile->dents[AAFS_PROF_HASH] = dent; in __aa_fs_profile_mkdir()
460 list_for_each_entry(child, &profile->base.profiles, base.list) { in __aa_fs_profile_mkdir()
461 error = __aa_fs_profile_mkdir(child, prof_child_dir(profile)); in __aa_fs_profile_mkdir()
472 __aa_fs_profile_rmdir(profile); in __aa_fs_profile_mkdir()
663 struct aa_profile *profile) in next_profile() argument
665 struct aa_profile *next = __next_profile(profile); in next_profile()
670 return __first_profile(root, __next_namespace(root, profile->ns)); in next_profile()
684 struct aa_profile *profile = NULL; in p_start() local
692 profile = __first_profile(root, root); in p_start()
695 for (; profile && l > 0; l--) in p_start()
696 profile = next_profile(root, profile); in p_start()
698 return profile; in p_start()
713 struct aa_profile *profile = p; in p_next() local
717 return next_profile(ns, profile); in p_next()
729 struct aa_profile *profile = p; in p_stop() local
732 if (profile) { in p_stop()
733 for (ns = profile->ns; ns && ns != root; ns = ns->parent) in p_stop()
749 struct aa_profile *profile = (struct aa_profile *)p; in seq_show_profile() local
752 if (profile->ns != root) in seq_show_profile()
753 seq_printf(f, ":%s://", aa_ns_name(root, profile->ns)); in seq_show_profile()
754 seq_printf(f, "%s (%s)\n", profile->base.hname, in seq_show_profile()
755 aa_profile_mode_names[profile->mode]); in seq_show_profile()