Commit a092ee20 authored by Eric Paris's avatar Eric Paris

fsnotify: allow groups to set freeing_mark to null

Most fsnotify listeners (all but inotify) do not care about marks being
freed.  Allow groups to set freeing_mark to null and do not call any
function if it is set that way.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent e42e2773
...@@ -161,12 +161,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group, ...@@ -161,12 +161,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
return send; return send;
} }
static void dnotify_freeing_mark(struct fsnotify_mark_entry *entry,
struct fsnotify_group *group)
{
/* dnotify doesn't care than an inode is on the way out */
}
static void dnotify_free_mark(struct fsnotify_mark_entry *entry) static void dnotify_free_mark(struct fsnotify_mark_entry *entry)
{ {
struct dnotify_mark_entry *dnentry = container_of(entry, struct dnotify_mark_entry *dnentry = container_of(entry,
...@@ -182,7 +176,7 @@ static struct fsnotify_ops dnotify_fsnotify_ops = { ...@@ -182,7 +176,7 @@ static struct fsnotify_ops dnotify_fsnotify_ops = {
.handle_event = dnotify_handle_event, .handle_event = dnotify_handle_event,
.should_send_event = dnotify_should_send_event, .should_send_event = dnotify_should_send_event,
.free_group_priv = NULL, .free_group_priv = NULL,
.freeing_mark = dnotify_freeing_mark, .freeing_mark = NULL,
.free_event_priv = NULL, .free_event_priv = NULL,
}; };
......
...@@ -190,6 +190,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) ...@@ -190,6 +190,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
* callback to the group function to let it know that this entry * callback to the group function to let it know that this entry
* is being freed. * is being freed.
*/ */
if (group->ops->freeing_mark)
group->ops->freeing_mark(entry, group); group->ops->freeing_mark(entry, group);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment