Lines Matching refs:parent
41 struct audit_parent *parent; /* associated parent */ member
58 static void audit_free_parent(struct audit_parent *parent) in audit_free_parent() argument
60 WARN_ON(!list_empty(&parent->watches)); in audit_free_parent()
61 kfree(parent); in audit_free_parent()
66 struct audit_parent *parent; in audit_watch_free_mark() local
68 parent = container_of(entry, struct audit_parent, mark); in audit_watch_free_mark()
69 audit_free_parent(parent); in audit_watch_free_mark()
72 static void audit_get_parent(struct audit_parent *parent) in audit_get_parent() argument
74 if (likely(parent)) in audit_get_parent()
75 fsnotify_get_mark(&parent->mark); in audit_get_parent()
78 static void audit_put_parent(struct audit_parent *parent) in audit_put_parent() argument
80 if (likely(parent)) in audit_put_parent()
81 fsnotify_put_mark(&parent->mark); in audit_put_parent()
90 struct audit_parent *parent = NULL; in audit_find_parent() local
95 parent = container_of(entry, struct audit_parent, mark); in audit_find_parent()
97 return parent; in audit_find_parent()
108 WARN_ON(watch->parent); in audit_put_watch()
118 audit_put_parent(watch->parent); in audit_remove_watch()
119 watch->parent = NULL; in audit_remove_watch()
139 struct audit_parent *parent; in audit_init_parent() local
142 parent = kzalloc(sizeof(*parent), GFP_KERNEL); in audit_init_parent()
143 if (unlikely(!parent)) in audit_init_parent()
146 INIT_LIST_HEAD(&parent->watches); in audit_init_parent()
148 fsnotify_init_mark(&parent->mark, audit_watch_group); in audit_init_parent()
149 parent->mark.mask = AUDIT_FS_WATCH; in audit_init_parent()
150 ret = fsnotify_add_inode_mark(&parent->mark, inode, 0); in audit_init_parent()
152 audit_free_parent(parent); in audit_init_parent()
156 return parent; in audit_init_parent()
220 audit_get_parent(old->parent); in audit_dupe_watch()
221 new->parent = old->parent; in audit_dupe_watch()
245 static void audit_update_watch(struct audit_parent *parent, in audit_update_watch() argument
256 list_for_each_entry_safe(owatch, nextw, &parent->watches, wlist) { in audit_update_watch()
316 list_add(&nwatch->wlist, &parent->watches); in audit_update_watch()
322 static void audit_remove_parent_watches(struct audit_parent *parent) in audit_remove_parent_watches() argument
329 list_for_each_entry_safe(w, nextw, &parent->watches, wlist) { in audit_remove_parent_watches()
344 fsnotify_destroy_mark(&parent->mark, audit_watch_group); in audit_remove_parent_watches()
348 static int audit_get_nd(struct audit_watch *watch, struct path *parent) in audit_get_nd() argument
350 struct dentry *d = kern_path_locked(watch->path, parent); in audit_get_nd()
358 inode_unlock(d_backing_inode(parent->dentry)); in audit_get_nd()
366 struct audit_parent *parent) in audit_add_to_parent() argument
373 list_for_each_entry(w, &parent->watches, wlist) { in audit_add_to_parent()
385 audit_put_parent(parent); in audit_add_to_parent()
390 watch->parent = parent; in audit_add_to_parent()
393 list_add(&watch->wlist, &parent->watches); in audit_add_to_parent()
403 struct audit_parent *parent; in audit_add_watch() local
428 parent = audit_find_parent(d_backing_inode(parent_path.dentry)); in audit_add_watch()
429 if (!parent) { in audit_add_watch()
430 parent = audit_init_parent(&parent_path); in audit_add_watch()
431 if (IS_ERR(parent)) { in audit_add_watch()
432 ret = PTR_ERR(parent); in audit_add_watch()
437 audit_add_to_parent(krule, parent); in audit_add_watch()
450 struct audit_parent *parent = watch->parent; in audit_remove_watch_rule() local
459 audit_get_parent(parent); in audit_remove_watch_rule()
461 if (list_empty(&parent->watches)) in audit_remove_watch_rule()
462 fsnotify_destroy_mark(&parent->mark, audit_watch_group); in audit_remove_watch_rule()
463 audit_put_parent(parent); in audit_remove_watch_rule()
472 struct audit_parent *parent; in audit_watch_handle_event() local
474 parent = container_of(inode_mark, struct audit_parent, mark); in audit_watch_handle_event()
480 audit_update_watch(parent, dname, inode->i_sb->s_dev, inode->i_ino, 0); in audit_watch_handle_event()
482 audit_update_watch(parent, dname, AUDIT_DEV_UNSET, AUDIT_INO_UNSET, 1); in audit_watch_handle_event()
484 audit_remove_parent_watches(parent); in audit_watch_handle_event()