Skip to content

Commit

Permalink
fsnotify: allow groups to set freeing_mark to null
Browse files Browse the repository at this point in the history
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: Eric Paris <eparis@redhat.com>
  • Loading branch information
eparis committed Jun 11, 2009
1 parent e42e277 commit a092ee2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions fs/notify/dnotify/dnotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
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)
{
struct dnotify_mark_entry *dnentry = container_of(entry,
Expand All @@ -182,7 +176,7 @@ static struct fsnotify_ops dnotify_fsnotify_ops = {
.handle_event = dnotify_handle_event,
.should_send_event = dnotify_should_send_event,
.free_group_priv = NULL,
.freeing_mark = dnotify_freeing_mark,
.freeing_mark = NULL,
.free_event_priv = NULL,
};

Expand Down
3 changes: 2 additions & 1 deletion fs/notify/inode_mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
* callback to the group function to let it know that this entry
* is being freed.
*/
group->ops->freeing_mark(entry, group);
if (group->ops->freeing_mark)
group->ops->freeing_mark(entry, group);

/*
* __fsnotify_update_child_dentry_flags(inode);
Expand Down

0 comments on commit a092ee2

Please sign in to comment.