21 #include <linux/kernel.h>
22 #include <linux/module.h>
35 struct fsnotify_mark *
mark, *lmark;
37 struct mount *
m = real_mount(mnt);
42 list_add(&mark->m.free_m_list, &
free_list);
43 hlist_del_init_rcu(&mark->m.m_list);
62 static void fsnotify_recalc_vfsmount_mask_locked(
struct vfsmount *
mnt)
64 struct mount *
m = real_mount(mnt);
65 struct fsnotify_mark *
mark;
72 new_mask |= mark->
mask;
73 m->mnt_fsnotify_mask = new_mask;
82 spin_lock(&mnt->mnt_root->d_lock);
83 fsnotify_recalc_vfsmount_mask_locked(mnt);
84 spin_unlock(&mnt->mnt_root->d_lock);
96 hlist_del_init_rcu(&mark->m.m_list);
99 fsnotify_recalc_vfsmount_mask_locked(mnt);
101 spin_unlock(&mnt->
mnt_root->d_lock);
104 static struct fsnotify_mark *fsnotify_find_vfsmount_mark_locked(
struct fsnotify_group *
group,
107 struct mount *m = real_mount(mnt);
108 struct fsnotify_mark *
mark;
114 if (mark->group == group) {
129 struct fsnotify_mark *
mark;
132 mark = fsnotify_find_vfsmount_mark_locked(group, mnt);
133 spin_unlock(&mnt->
mnt_root->d_lock);
144 struct fsnotify_group *group,
struct vfsmount *mnt,
147 struct mount *m = real_mount(mnt);
148 struct fsnotify_mark *lmark;
152 mark->flags |= FSNOTIFY_MARK_FLAG_VFSMOUNT;
162 if (hlist_empty(&m->mnt_fsnotify_marks)) {
163 hlist_add_head_rcu(&mark->m.m_list, &m->mnt_fsnotify_marks);
171 if ((lmark->group == group) && !allow_dups) {
176 if (mark->group->priority < lmark->group->priority)
179 if ((mark->group->priority == lmark->group->priority) &&
180 (mark->group < lmark->group))
183 hlist_add_before_rcu(&mark->m.m_list, &lmark->m.m_list);
189 hlist_add_after_rcu(last, &mark->m.m_list);
191 fsnotify_recalc_vfsmount_mask_locked(mnt);
192 spin_unlock(&mnt->
mnt_root->d_lock);