Skip to content

Commit a092ee2

Browse files
committed
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: Eric Paris <eparis@redhat.com>
1 parent e42e277 commit a092ee2

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

fs/notify/dnotify/dnotify.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ static bool dnotify_should_send_event(struct fsnotify_group *group,
161161
return send;
162162
}
163163

164-
static void dnotify_freeing_mark(struct fsnotify_mark_entry *entry,
165-
struct fsnotify_group *group)
166-
{
167-
/* dnotify doesn't care than an inode is on the way out */
168-
}
169-
170164
static void dnotify_free_mark(struct fsnotify_mark_entry *entry)
171165
{
172166
struct dnotify_mark_entry *dnentry = container_of(entry,
@@ -182,7 +176,7 @@ static struct fsnotify_ops dnotify_fsnotify_ops = {
182176
.handle_event = dnotify_handle_event,
183177
.should_send_event = dnotify_should_send_event,
184178
.free_group_priv = NULL,
185-
.freeing_mark = dnotify_freeing_mark,
179+
.freeing_mark = NULL,
186180
.free_event_priv = NULL,
187181
};
188182

fs/notify/inode_mark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
190190
* callback to the group function to let it know that this entry
191191
* is being freed.
192192
*/
193-
group->ops->freeing_mark(entry, group);
193+
if (group->ops->freeing_mark)
194+
group->ops->freeing_mark(entry, group);
194195

195196
/*
196197
* __fsnotify_update_child_dentry_flags(inode);

0 commit comments

Comments
 (0)