aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/notify/fanotify/fanotify_user.c8
-rw-r--r--fs/notify/group.c10
-rw-r--r--include/linux/fsnotify_backend.h1
-rw-r--r--include/linux/syscalls.h3
4 files changed, 7 insertions, 15 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 7c869fa23ec6..664102084766 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -616,14 +616,13 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
616} 616}
617 617
618/* fanotify syscalls */ 618/* fanotify syscalls */
619SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags, 619SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
620 unsigned int, priority)
621{ 620{
622 struct fsnotify_group *group; 621 struct fsnotify_group *group;
623 int f_flags, fd; 622 int f_flags, fd;
624 623
625 pr_debug("%s: flags=%d event_f_flags=%d priority=%d\n", 624 pr_debug("%s: flags=%d event_f_flags=%d\n",
626 __func__, flags, event_f_flags, priority); 625 __func__, flags, event_f_flags);
627 626
628 if (event_f_flags) 627 if (event_f_flags)
629 return -EINVAL; 628 return -EINVAL;
@@ -645,7 +644,6 @@ SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags,
645 if (IS_ERR(group)) 644 if (IS_ERR(group))
646 return PTR_ERR(group); 645 return PTR_ERR(group);
647 646
648 group->priority = priority;
649#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS 647#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
650 mutex_init(&group->fanotify_data.access_mutex); 648 mutex_init(&group->fanotify_data.access_mutex);
651 init_waitqueue_head(&group->fanotify_data.access_waitq); 649 init_waitqueue_head(&group->fanotify_data.access_waitq);
diff --git a/fs/notify/group.c b/fs/notify/group.c
index ada913fd4f7f..7ac65ed4735b 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
@@ -90,7 +90,6 @@ void fsnotify_recalc_group_mask(struct fsnotify_group *group)
90void fsnotify_add_vfsmount_group(struct fsnotify_group *group) 90void fsnotify_add_vfsmount_group(struct fsnotify_group *group)
91{ 91{
92 struct fsnotify_group *group_iter; 92 struct fsnotify_group *group_iter;
93 unsigned int priority = group->priority;
94 93
95 mutex_lock(&fsnotify_grp_mutex); 94 mutex_lock(&fsnotify_grp_mutex);
96 95
@@ -98,7 +97,7 @@ void fsnotify_add_vfsmount_group(struct fsnotify_group *group)
98 list_for_each_entry(group_iter, &fsnotify_vfsmount_groups, 97 list_for_each_entry(group_iter, &fsnotify_vfsmount_groups,
99 vfsmount_group_list) { 98 vfsmount_group_list) {
100 /* insert in front of this one? */ 99 /* insert in front of this one? */
101 if (priority < group_iter->priority) { 100 if (group < group_iter) {
102 /* list_add_tail() insert in front of group_iter */ 101 /* list_add_tail() insert in front of group_iter */
103 list_add_tail_rcu(&group->inode_group_list, 102 list_add_tail_rcu(&group->inode_group_list,
104 &group_iter->inode_group_list); 103 &group_iter->inode_group_list);
@@ -118,15 +117,14 @@ out:
118void fsnotify_add_inode_group(struct fsnotify_group *group) 117void fsnotify_add_inode_group(struct fsnotify_group *group)
119{ 118{
120 struct fsnotify_group *group_iter; 119 struct fsnotify_group *group_iter;
121 unsigned int priority = group->priority;
122 120
123 mutex_lock(&fsnotify_grp_mutex); 121 mutex_lock(&fsnotify_grp_mutex);
124 122
125 /* add to global group list, priority 0 first, UINT_MAX last */ 123 /* add to global group list */
126 if (!group->on_inode_group_list) { 124 if (!group->on_inode_group_list) {
127 list_for_each_entry(group_iter, &fsnotify_inode_groups, 125 list_for_each_entry(group_iter, &fsnotify_inode_groups,
128 inode_group_list) { 126 inode_group_list) {
129 if (priority < group_iter->priority) { 127 if (group < group_iter) {
130 /* list_add_tail() insert in front of group_iter */ 128 /* list_add_tail() insert in front of group_iter */
131 list_add_tail_rcu(&group->inode_group_list, 129 list_add_tail_rcu(&group->inode_group_list,
132 &group_iter->inode_group_list); 130 &group_iter->inode_group_list);
@@ -260,8 +258,6 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
260 spin_lock_init(&group->mark_lock); 258 spin_lock_init(&group->mark_lock);
261 INIT_LIST_HEAD(&group->marks_list); 259 INIT_LIST_HEAD(&group->marks_list);
262 260
263 group->priority = UINT_MAX;
264
265 group->ops = ops; 261 group->ops = ops;
266 262
267 return group; 263 return group;
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index b0d00fd6bfad..b9b3f24ad4fc 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -143,7 +143,6 @@ struct fsnotify_group {
143 * a group */ 143 * a group */
144 struct list_head marks_list; /* all inode marks for this group */ 144 struct list_head marks_list; /* all inode marks for this group */
145 145
146 unsigned int priority; /* order of this group compared to others */
147 /* prevents double list_del of group_list. protected by global fsnotify_grp_mutex */ 146 /* prevents double list_del of group_list. protected by global fsnotify_grp_mutex */
148 bool on_inode_group_list; 147 bool on_inode_group_list;
149 bool on_vfsmount_group_list; 148 bool on_vfsmount_group_list;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 5b05c37059e9..0ec26a74f20a 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -813,8 +813,7 @@ asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
813asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, 813asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
814 struct timespec __user *, const sigset_t __user *, 814 struct timespec __user *, const sigset_t __user *,
815 size_t); 815 size_t);
816asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags, 816asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags);
817 unsigned int priority);
818asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, 817asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
819 u64 mask, int fd, 818 u64 mask, int fd,
820 const char __user *pathname); 819 const char __user *pathname);