diff options
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 14 | ||||
-rw-r--r-- | include/linux/fsnotify_backend.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 8f5e85269110..2a57278afb80 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -134,7 +134,7 @@ static struct fanotify_perm_event_info *dequeue_event( | |||
134 | { | 134 | { |
135 | struct fanotify_perm_event_info *event, *return_e = NULL; | 135 | struct fanotify_perm_event_info *event, *return_e = NULL; |
136 | 136 | ||
137 | mutex_lock(&group->fanotify_data.access_mutex); | 137 | spin_lock(&group->fanotify_data.access_lock); |
138 | list_for_each_entry(event, &group->fanotify_data.access_list, | 138 | list_for_each_entry(event, &group->fanotify_data.access_list, |
139 | fae.fse.list) { | 139 | fae.fse.list) { |
140 | if (event->fd != fd) | 140 | if (event->fd != fd) |
@@ -144,7 +144,7 @@ static struct fanotify_perm_event_info *dequeue_event( | |||
144 | return_e = event; | 144 | return_e = event; |
145 | break; | 145 | break; |
146 | } | 146 | } |
147 | mutex_unlock(&group->fanotify_data.access_mutex); | 147 | spin_unlock(&group->fanotify_data.access_lock); |
148 | 148 | ||
149 | pr_debug("%s: found return_re=%p\n", __func__, return_e); | 149 | pr_debug("%s: found return_re=%p\n", __func__, return_e); |
150 | 150 | ||
@@ -213,10 +213,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, | |||
213 | 213 | ||
214 | pevent = FANOTIFY_PE(event); | 214 | pevent = FANOTIFY_PE(event); |
215 | pevent->fd = fd; | 215 | pevent->fd = fd; |
216 | mutex_lock(&group->fanotify_data.access_mutex); | 216 | spin_lock(&group->fanotify_data.access_lock); |
217 | list_add_tail(&pevent->fae.fse.list, | 217 | list_add_tail(&pevent->fae.fse.list, |
218 | &group->fanotify_data.access_list); | 218 | &group->fanotify_data.access_list); |
219 | mutex_unlock(&group->fanotify_data.access_mutex); | 219 | spin_unlock(&group->fanotify_data.access_lock); |
220 | } | 220 | } |
221 | #endif | 221 | #endif |
222 | 222 | ||
@@ -346,7 +346,7 @@ static int fanotify_release(struct inode *ignored, struct file *file) | |||
346 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | 346 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
347 | struct fanotify_perm_event_info *event, *next; | 347 | struct fanotify_perm_event_info *event, *next; |
348 | 348 | ||
349 | mutex_lock(&group->fanotify_data.access_mutex); | 349 | spin_lock(&group->fanotify_data.access_lock); |
350 | 350 | ||
351 | atomic_inc(&group->fanotify_data.bypass_perm); | 351 | atomic_inc(&group->fanotify_data.bypass_perm); |
352 | 352 | ||
@@ -358,7 +358,7 @@ static int fanotify_release(struct inode *ignored, struct file *file) | |||
358 | list_del_init(&event->fae.fse.list); | 358 | list_del_init(&event->fae.fse.list); |
359 | event->response = FAN_ALLOW; | 359 | event->response = FAN_ALLOW; |
360 | } | 360 | } |
361 | mutex_unlock(&group->fanotify_data.access_mutex); | 361 | spin_unlock(&group->fanotify_data.access_lock); |
362 | 362 | ||
363 | wake_up(&group->fanotify_data.access_waitq); | 363 | wake_up(&group->fanotify_data.access_waitq); |
364 | #endif | 364 | #endif |
@@ -700,7 +700,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) | |||
700 | 700 | ||
701 | group->fanotify_data.f_flags = event_f_flags; | 701 | group->fanotify_data.f_flags = event_f_flags; |
702 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | 702 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
703 | mutex_init(&group->fanotify_data.access_mutex); | 703 | spin_lock_init(&group->fanotify_data.access_lock); |
704 | init_waitqueue_head(&group->fanotify_data.access_waitq); | 704 | init_waitqueue_head(&group->fanotify_data.access_waitq); |
705 | INIT_LIST_HEAD(&group->fanotify_data.access_list); | 705 | INIT_LIST_HEAD(&group->fanotify_data.access_list); |
706 | atomic_set(&group->fanotify_data.bypass_perm, 0); | 706 | atomic_set(&group->fanotify_data.bypass_perm, 0); |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 64cf3ef50696..fc7718c6bd3e 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -178,7 +178,7 @@ struct fsnotify_group { | |||
178 | struct fanotify_group_private_data { | 178 | struct fanotify_group_private_data { |
179 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | 179 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
180 | /* allows a group to block waiting for a userspace response */ | 180 | /* allows a group to block waiting for a userspace response */ |
181 | struct mutex access_mutex; | 181 | spinlock_t access_lock; |
182 | struct list_head access_list; | 182 | struct list_head access_list; |
183 | wait_queue_head_t access_waitq; | 183 | wait_queue_head_t access_waitq; |
184 | atomic_t bypass_perm; | 184 | atomic_t bypass_perm; |