Lines Matching refs:mark

28 	struct fsnotify_mark *mark;
41 struct fsnotify_mark mark;
51 * audit_tree_mark (fsnotify mark). We replace struct chunk on tagging /
52 * untagging, the mark is stable as long as there is chunk attached. The
53 * association between mark and chunk is protected by hash_lock and
55 * audit_tree_group->mark_mutex and check that the mark is alive by
56 * FSNOTIFY_MARK_FLAG_ATTACHED flag check, we are sure the mark points to
78 * one chunk reference. This reference is dropped either when a mark is going
80 * mark gets replaced. This reference must be dropped using
85 * MSB of that sucker is stolen to mark taggings that we might have to
154 * Drop reference to the chunk that was held by the mark. This is the reference
163 static inline struct audit_tree_mark *audit_mark(struct fsnotify_mark *mark)
165 return container_of(mark, struct audit_tree_mark, mark);
168 static struct audit_chunk *mark_chunk(struct fsnotify_mark *mark)
170 return audit_mark(mark)->chunk;
173 static void audit_tree_destroy_watch(struct fsnotify_mark *mark)
175 kmem_cache_free(audit_tree_mark_cachep, audit_mark(mark));
185 fsnotify_init_mark(&amark->mark, audit_tree_group);
186 amark->mark.mask = FS_IN_IGNORED;
187 return &amark->mark;
227 /* hash_lock & mark->group->mark_mutex is held by caller */
281 static void replace_mark_chunk(struct fsnotify_mark *mark,
287 old = mark_chunk(mark);
288 audit_mark(mark)->chunk = chunk;
290 chunk->mark = mark;
292 old->mark = NULL;
317 replace_mark_chunk(old->mark, new);
351 static void untag_chunk(struct audit_chunk *chunk, struct fsnotify_mark *mark)
358 * mark_mutex stabilizes chunk attached to the mark so we can check
361 if (!(mark->flags & FSNOTIFY_MARK_FLAG_ATTACHED) ||
362 mark_chunk(mark) != chunk)
370 replace_mark_chunk(mark, NULL);
372 fsnotify_detach_mark(mark);
375 fsnotify_free_mark(mark);
401 struct fsnotify_mark *mark;
409 mark = alloc_mark();
410 if (!mark) {
416 if (fsnotify_add_inode_mark_locked(mark, inode, 0)) {
418 fsnotify_put_mark(mark);
426 fsnotify_detach_mark(mark);
428 fsnotify_free_mark(mark);
429 fsnotify_put_mark(mark);
433 replace_mark_chunk(mark, chunk);
451 * Drop our initial reference. When mark we point to is getting freed,
453 * chunk pointing to this mark.
455 fsnotify_put_mark(mark);
462 struct fsnotify_mark *mark;
468 mark = fsnotify_find_inode_mark(inode, audit_tree_group);
469 if (!mark)
473 * Found mark is guaranteed to be attached and mark_mutex protects mark
475 * to the mark.
479 old = mark_chunk(mark);
484 fsnotify_put_mark(mark);
493 fsnotify_put_mark(mark);
501 fsnotify_put_mark(mark);
521 fsnotify_put_mark(mark); /* pair to fsnotify_find_mark */
594 struct fsnotify_mark *mark;
601 mark = chunk->mark;
604 if (!mark)
606 fsnotify_get_mark(mark);
609 untag_chunk(chunk, mark);
610 fsnotify_put_mark(mark);
1059 static int audit_tree_handle_event(struct fsnotify_mark *mark, u32 mask,
1066 static void audit_tree_freeing_mark(struct fsnotify_mark *mark,
1071 fsnotify_group_lock(mark->group);
1073 chunk = mark_chunk(mark);
1074 replace_mark_chunk(mark, NULL);
1076 fsnotify_group_unlock(mark->group);
1083 * We are guaranteed to have at least one reference to the mark from
1086 BUG_ON(refcount_read(&mark->refcnt) < 1);