Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fsnotify: rename event handling functions

Rename fsnotify_add_notify_event() to fsnotify_add_event() since the
"notify" part is duplicit. Rename fsnotify_remove_notify_event() and
fsnotify_peek_notify_event() to fsnotify_remove_first_event() and
fsnotify_peek_first_event() respectively since "notify" part is duplicit
and they really look at the first event in the queue.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jan Kara and committed by
Linus Torvalds
8ba8fa91 3e584064

+21 -20
+1 -1
fs/notify/fanotify/fanotify.c
··· 210 210 return -ENOMEM; 211 211 212 212 fsn_event = &event->fse; 213 - ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge); 213 + ret = fsnotify_add_event(group, fsn_event, fanotify_merge); 214 214 if (ret) { 215 215 /* Permission events shouldn't be merged */ 216 216 BUG_ON(ret == 1 && mask & FAN_ALL_PERM_EVENTS);
+1 -1
fs/notify/fanotify/fanotify_user.c
··· 66 66 67 67 /* held the notification_mutex the whole time, so this is the 68 68 * same event we peeked above */ 69 - return fsnotify_remove_notify_event(group); 69 + return fsnotify_remove_first_event(group); 70 70 } 71 71 72 72 static int create_fd(struct fsnotify_group *group,
+1 -1
fs/notify/inotify/inotify_fsnotify.c
··· 108 108 if (len) 109 109 strcpy(event->name, file_name); 110 110 111 - ret = fsnotify_add_notify_event(group, fsn_event, inotify_merge); 111 + ret = fsnotify_add_event(group, fsn_event, inotify_merge); 112 112 if (ret) { 113 113 /* Our event wasn't used in the end. Free it. */ 114 114 fsnotify_destroy_event(group, fsn_event);
+2 -2
fs/notify/inotify/inotify_user.c
··· 149 149 if (fsnotify_notify_queue_is_empty(group)) 150 150 return NULL; 151 151 152 - event = fsnotify_peek_notify_event(group); 152 + event = fsnotify_peek_first_event(group); 153 153 154 154 pr_debug("%s: group=%p event=%p\n", __func__, group, event); 155 155 ··· 159 159 160 160 /* held the notification_mutex the whole time, so this is the 161 161 * same event we peeked above */ 162 - fsnotify_remove_notify_event(group); 162 + fsnotify_remove_first_event(group); 163 163 164 164 return event; 165 165 }
+10 -9
fs/notify/notification.c
··· 83 83 * added to the queue, 1 if the event was merged with some other queued event, 84 84 * 2 if the queue of events has overflown. 85 85 */ 86 - int fsnotify_add_notify_event(struct fsnotify_group *group, 87 - struct fsnotify_event *event, 88 - int (*merge)(struct list_head *, 89 - struct fsnotify_event *)) 86 + int fsnotify_add_event(struct fsnotify_group *group, 87 + struct fsnotify_event *event, 88 + int (*merge)(struct list_head *, 89 + struct fsnotify_event *)) 90 90 { 91 91 int ret = 0; 92 92 struct list_head *list = &group->notification_list; ··· 128 128 * Remove and return the first event from the notification list. It is the 129 129 * responsibility of the caller to destroy the obtained event 130 130 */ 131 - struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group) 131 + struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group) 132 132 { 133 133 struct fsnotify_event *event; 134 134 ··· 140 140 struct fsnotify_event, list); 141 141 /* 142 142 * We need to init list head for the case of overflow event so that 143 - * check in fsnotify_add_notify_events() works 143 + * check in fsnotify_add_event() works 144 144 */ 145 145 list_del_init(&event->list); 146 146 group->q_len--; ··· 149 149 } 150 150 151 151 /* 152 - * This will not remove the event, that must be done with fsnotify_remove_notify_event() 152 + * This will not remove the event, that must be done with 153 + * fsnotify_remove_first_event() 153 154 */ 154 - struct fsnotify_event *fsnotify_peek_notify_event(struct fsnotify_group *group) 155 + struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group) 155 156 { 156 157 BUG_ON(!mutex_is_locked(&group->notification_mutex)); 157 158 ··· 170 169 171 170 mutex_lock(&group->notification_mutex); 172 171 while (!fsnotify_notify_queue_is_empty(group)) { 173 - event = fsnotify_remove_notify_event(group); 172 + event = fsnotify_remove_first_event(group); 174 173 fsnotify_destroy_event(group, event); 175 174 } 176 175 mutex_unlock(&group->notification_mutex);
+6 -6
include/linux/fsnotify_backend.h
··· 322 322 extern void fsnotify_destroy_event(struct fsnotify_group *group, 323 323 struct fsnotify_event *event); 324 324 /* attach the event to the group notification queue */ 325 - extern int fsnotify_add_notify_event(struct fsnotify_group *group, 326 - struct fsnotify_event *event, 327 - int (*merge)(struct list_head *, 328 - struct fsnotify_event *)); 325 + extern int fsnotify_add_event(struct fsnotify_group *group, 326 + struct fsnotify_event *event, 327 + int (*merge)(struct list_head *, 328 + struct fsnotify_event *)); 329 329 /* true if the group notification queue is empty */ 330 330 extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); 331 331 /* return, but do not dequeue the first event on the notification queue */ 332 - extern struct fsnotify_event *fsnotify_peek_notify_event(struct fsnotify_group *group); 332 + extern struct fsnotify_event *fsnotify_peek_first_event(struct fsnotify_group *group); 333 333 /* return AND dequeue the first event on the notification queue */ 334 - extern struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group); 334 + extern struct fsnotify_event *fsnotify_remove_first_event(struct fsnotify_group *group); 335 335 336 336 /* functions used to manipulate the marks attached to inodes */ 337 337