Lines Matching refs:fsn_mark
1051 static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark, in fanotify_mark_remove_from_mask() argument
1059 spin_lock(&fsn_mark->lock); in fanotify_mark_remove_from_mask()
1060 oldmask = fsnotify_calc_mask(fsn_mark); in fanotify_mark_remove_from_mask()
1062 fsn_mark->mask &= ~mask; in fanotify_mark_remove_from_mask()
1064 fsn_mark->ignore_mask &= ~mask; in fanotify_mark_remove_from_mask()
1066 newmask = fsnotify_calc_mask(fsn_mark); in fanotify_mark_remove_from_mask()
1073 *destroy = !((fsn_mark->mask | fsn_mark->ignore_mask) & ~umask); in fanotify_mark_remove_from_mask()
1074 spin_unlock(&fsn_mark->lock); in fanotify_mark_remove_from_mask()
1083 struct fsnotify_mark *fsn_mark = NULL; in fanotify_remove_mark() local
1088 fsn_mark = fsnotify_find_mark(connp, group); in fanotify_remove_mark()
1089 if (!fsn_mark) { in fanotify_remove_mark()
1094 removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags, in fanotify_remove_mark()
1096 if (removed & fsnotify_conn_mask(fsn_mark->connector)) in fanotify_remove_mark()
1097 fsnotify_recalc_mask(fsn_mark->connector); in fanotify_remove_mark()
1099 fsnotify_detach_mark(fsn_mark); in fanotify_remove_mark()
1102 fsnotify_free_mark(fsn_mark); in fanotify_remove_mark()
1105 fsnotify_put_mark(fsn_mark); in fanotify_remove_mark()
1133 static bool fanotify_mark_update_flags(struct fsnotify_mark *fsn_mark, in fanotify_mark_update_flags() argument
1147 fsn_mark->flags |= FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS; in fanotify_mark_update_flags()
1155 !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)) { in fanotify_mark_update_flags()
1156 fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY; in fanotify_mark_update_flags()
1157 if (!(fsn_mark->mask & FS_MODIFY)) in fanotify_mark_update_flags()
1161 if (fsn_mark->connector->type != FSNOTIFY_OBJ_TYPE_INODE || in fanotify_mark_update_flags()
1162 want_iref == !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_NO_IREF)) in fanotify_mark_update_flags()
1170 fsn_mark->flags &= ~FSNOTIFY_MARK_FLAG_NO_IREF; in fanotify_mark_update_flags()
1175 static bool fanotify_mark_add_to_mask(struct fsnotify_mark *fsn_mark, in fanotify_mark_add_to_mask() argument
1180 spin_lock(&fsn_mark->lock); in fanotify_mark_add_to_mask()
1182 fsn_mark->mask |= mask; in fanotify_mark_add_to_mask()
1184 fsn_mark->ignore_mask |= mask; in fanotify_mark_add_to_mask()
1186 recalc = fsnotify_calc_mask(fsn_mark) & in fanotify_mark_add_to_mask()
1187 ~fsnotify_conn_mask(fsn_mark->connector); in fanotify_mark_add_to_mask()
1189 recalc |= fanotify_mark_update_flags(fsn_mark, fan_flags); in fanotify_mark_add_to_mask()
1190 spin_unlock(&fsn_mark->lock); in fanotify_mark_add_to_mask()
1248 static int fanotify_may_update_existing_mark(struct fsnotify_mark *fsn_mark, in fanotify_may_update_existing_mark() argument
1255 !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_NO_IREF)) in fanotify_may_update_existing_mark()
1262 fsn_mark->flags & FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS) in fanotify_may_update_existing_mark()
1273 fsn_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY) in fanotify_may_update_existing_mark()
1284 struct fsnotify_mark *fsn_mark; in fanotify_add_mark() local
1289 fsn_mark = fsnotify_find_mark(connp, group); in fanotify_add_mark()
1290 if (!fsn_mark) { in fanotify_add_mark()
1291 fsn_mark = fanotify_add_new_mark(group, connp, obj_type, in fanotify_add_mark()
1293 if (IS_ERR(fsn_mark)) { in fanotify_add_mark()
1295 return PTR_ERR(fsn_mark); in fanotify_add_mark()
1302 ret = fanotify_may_update_existing_mark(fsn_mark, fan_flags); in fanotify_add_mark()
1317 recalc = fanotify_mark_add_to_mask(fsn_mark, mask, fan_flags); in fanotify_add_mark()
1319 fsnotify_recalc_mask(fsn_mark->connector); in fanotify_add_mark()
1324 fsnotify_put_mark(fsn_mark); in fanotify_add_mark()