notification.c (32c3263221bd63316815286dccacdc7abfd7f3c4) | notification.c (6e5f77b32e9097a8a68a8d453799676cacf70cad) |
---|---|
1/* 2 * Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2, or (at your option) 7 * any later version. 8 * --- 123 unchanged lines hidden (view full) --- 132 133/* 134 * Add an event to the group notification queue. The group can later pull this 135 * event off the queue to deal with. If the event is successfully added to the 136 * group's notification queue, a reference is taken on event. 137 */ 138int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_event *event, 139 struct fsnotify_event_private_data *priv, | 1/* 2 * Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2, or (at your option) 7 * any later version. 8 * --- 123 unchanged lines hidden (view full) --- 132 133/* 134 * Add an event to the group notification queue. The group can later pull this 135 * event off the queue to deal with. If the event is successfully added to the 136 * group's notification queue, a reference is taken on event. 137 */ 138int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_event *event, 139 struct fsnotify_event_private_data *priv, |
140 int (*merge)(struct list_head *, struct fsnotify_event *)) | 140 int (*merge)(struct list_head *, 141 struct fsnotify_event *, 142 void **arg), 143 void **arg) |
141{ 142 struct fsnotify_event_holder *holder = NULL; 143 struct list_head *list = &group->notification_list; 144 int rc = 0; 145 146 /* 147 * There is one fsnotify_event_holder embedded inside each fsnotify_event. 148 * Check if we expect to be able to use that holder. If not alloc a new --- 16 unchanged lines hidden (view full) --- 165 rc = -EOVERFLOW; 166 /* sorry, no private data on the overflow event */ 167 priv = NULL; 168 } 169 170 if (!list_empty(list) && merge) { 171 int ret; 172 | 144{ 145 struct fsnotify_event_holder *holder = NULL; 146 struct list_head *list = &group->notification_list; 147 int rc = 0; 148 149 /* 150 * There is one fsnotify_event_holder embedded inside each fsnotify_event. 151 * Check if we expect to be able to use that holder. If not alloc a new --- 16 unchanged lines hidden (view full) --- 168 rc = -EOVERFLOW; 169 /* sorry, no private data on the overflow event */ 170 priv = NULL; 171 } 172 173 if (!list_empty(list) && merge) { 174 int ret; 175 |
173 ret = merge(list, event); | 176 ret = merge(list, event, arg); |
174 if (ret) { 175 mutex_unlock(&group->notification_mutex); 176 if (holder != &event->holder) 177 fsnotify_destroy_event_holder(holder); 178 return ret; 179 } 180 } 181 --- 253 unchanged lines hidden --- | 177 if (ret) { 178 mutex_unlock(&group->notification_mutex); 179 if (holder != &event->holder) 180 fsnotify_destroy_event_holder(holder); 181 return ret; 182 } 183 } 184 --- 253 unchanged lines hidden --- |