Lines Matching defs: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
152 * Drop reference to the chunk that was held by the mark. This is the reference
161 static inline struct audit_tree_mark *audit_mark(struct fsnotify_mark *mark)
163 return container_of(mark, struct audit_tree_mark, mark);
166 static struct audit_chunk *mark_chunk(struct fsnotify_mark *mark)
168 return audit_mark(mark)->chunk;
171 static void audit_tree_destroy_watch(struct fsnotify_mark *mark)
173 kmem_cache_free(audit_tree_mark_cachep, audit_mark(mark));
183 fsnotify_init_mark(&amark->mark, audit_tree_group);
184 amark->mark.mask = FS_IN_IGNORED;
185 return &amark->mark;
225 /* hash_lock & mark->group->mark_mutex is held by caller */
279 static void replace_mark_chunk(struct fsnotify_mark *mark,
285 old = mark_chunk(mark);
286 audit_mark(mark)->chunk = chunk;
288 chunk->mark = mark;
290 old->mark = NULL;
315 replace_mark_chunk(old->mark, new);
349 static void untag_chunk(struct audit_chunk *chunk, struct fsnotify_mark *mark)
356 * mark_mutex stabilizes chunk attached to the mark so we can check
359 if (!(mark->flags & FSNOTIFY_MARK_FLAG_ATTACHED) ||
360 mark_chunk(mark) != chunk)
368 replace_mark_chunk(mark, NULL);
370 fsnotify_detach_mark(mark);
373 fsnotify_free_mark(mark);
399 struct fsnotify_mark *mark;
407 mark = alloc_mark();
408 if (!mark) {
414 if (fsnotify_add_inode_mark_locked(mark, inode, 0)) {
416 fsnotify_put_mark(mark);
424 fsnotify_detach_mark(mark);
426 fsnotify_free_mark(mark);
427 fsnotify_put_mark(mark);
431 replace_mark_chunk(mark, chunk);
449 * Drop our initial reference. When mark we point to is getting freed,
451 * chunk pointing to this mark.
453 fsnotify_put_mark(mark);
460 struct fsnotify_mark *mark;
466 mark = fsnotify_find_mark(&inode->i_fsnotify_marks, audit_tree_group);
467 if (!mark)
471 * Found mark is guaranteed to be attached and mark_mutex protects mark
473 * to the mark.
477 old = mark_chunk(mark);
482 fsnotify_put_mark(mark);
491 fsnotify_put_mark(mark);
499 fsnotify_put_mark(mark);
519 fsnotify_put_mark(mark); /* pair to fsnotify_find_mark */
575 struct fsnotify_mark *mark;
582 mark = chunk->mark;
585 if (!mark)
587 fsnotify_get_mark(mark);
590 untag_chunk(chunk, mark);
591 fsnotify_put_mark(mark);
1035 static int audit_tree_handle_event(struct fsnotify_mark *mark, u32 mask,
1042 static void audit_tree_freeing_mark(struct fsnotify_mark *mark,
1047 fsnotify_group_lock(mark->group);
1049 chunk = mark_chunk(mark);
1050 replace_mark_chunk(mark, NULL);
1052 fsnotify_group_unlock(mark->group);
1059 * We are guaranteed to have at least one reference to the mark from
1062 BUG_ON(refcount_read(&mark->refcnt) < 1);