Lines Matching refs:new

324  * aa_alloc_profile - allocate, initialize and return a new profile
326 * @proxy: proxy to use OR null if to allocate a new one
437 * is used to load a new profile.
660 * Returns: new refcounted profile else NULL on failure
919 if (ent->new == profile)
921 if (strncmp(ent->new->base.hname, profile->base.hname, len) ==
922 0 && ent->new->base.hname[len] == 0)
923 return ent->new;
930 * __replace_profile - replace @old with @new on a list
932 * @new: profile to replace @old with (NOT NULL)
934 * Will duplicate and refcount elements that @new inherits from @old
937 * refcount @new for list, put @old list refcount
941 static void __replace_profile(struct aa_profile *old, struct aa_profile *new)
953 p = __find_child(&new->base.profiles, child->base.name);
962 /* list refcount transferred to @new */
964 rcu_assign_pointer(child->parent, aa_get_profile(new));
965 list_add_rcu(&child->base.list, &new->base.profiles);
970 if (!rcu_access_pointer(new->parent)) {
972 rcu_assign_pointer(new->parent, aa_get_profile(parent));
974 aa_label_replace(&old->label, &new->label);
976 __aafs_profile_migrate_dents(old, new);
978 if (list_empty(&new->base.list)) {
979 /* new is not on a list already */
980 list_replace_rcu(&old->base.list, &new->base.list);
981 aa_get_profile(new);
1013 static void share_name(struct aa_profile *old, struct aa_profile *new)
1015 aa_put_str(new->base.hname);
1017 new->base.hname = old->base.hname;
1018 new->base.name = old->base.name;
1019 new->label.hname = old->label.hname;
1025 static struct aa_profile *update_to_newest_parent(struct aa_profile *new)
1029 parent = rcu_dereference_protected(new->parent,
1030 mutex_is_locked(&new->ns->lock));
1036 rcu_assign_pointer(new->parent, newest);
1136 ent->new->rawdata = aa_get_loaddata(udata);
1137 error = __lookup_replace(ns, ent->new->base.hname,
1143 if (ent->new->rename) {
1144 error = __lookup_replace(ns, ent->new->rename,
1151 /* released when @new is freed */
1152 ent->new->ns = aa_get_ns(ns);
1159 policy = __lookup_parent(ns, ent->new->base.hname);
1162 p = __list_lookup_parent(&lh, ent->new);
1177 ent->new->base.hname,
1189 rcu_assign_pointer(ent->new->parent, aa_get_profile(p));
1192 /* create new fs entries for introspection if needed */
1204 if (rcu_access_pointer(ent->new->parent)) {
1206 p = aa_deref_parent(ent->new);
1209 parent = ns_subprofs_dir(ent->new->ns);
1210 error = __aafs_profile_mkdir(ent->new, parent);
1227 if (ent->old && ent->old->rawdata == ent->new->rawdata &&
1228 ent->new->rawdata) {
1230 audit_policy(label, op, ns_name, ent->new->base.hname,
1234 aa_put_proxy(ent->new->label.proxy);
1235 ent->new->label.proxy = NULL;
1243 audit_policy(label, op, ns_name, ent->new->base.hname, NULL,
1247 share_name(ent->old, ent->new);
1248 __replace_profile(ent->old, ent->new);
1252 if (rcu_access_pointer(ent->new->parent)) {
1255 parent = update_to_newest_parent(ent->new);
1259 __add_profile(lh, ent->new);
1282 audit_policy(label, op, ns_name, ent ? ent->new->base.hname : NULL,
1293 audit_policy(label, op, ns_name, tmp->new->base.hname, info,