Commit ba643f04 authored by Eric Paris's avatar Eric Paris

fsnotify: clear marks to 0 in fsnotify_init_mark

Currently fsnotify_init_mark sets some fields to 0/NULL.  Some users
already used some sorts of zalloc, some didn't.  This patch uses memset to
explicitly zero everything in the fsnotify_mark when it is initialized so we
don't have to be careful if fields are later added to marks.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 5444e298
...@@ -284,11 +284,8 @@ void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *ol ...@@ -284,11 +284,8 @@ void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *ol
void fsnotify_init_mark(struct fsnotify_mark *mark, void fsnotify_init_mark(struct fsnotify_mark *mark,
void (*free_mark)(struct fsnotify_mark *mark)) void (*free_mark)(struct fsnotify_mark *mark))
{ {
memset(mark, 0, sizeof(*mark));
spin_lock_init(&mark->lock); spin_lock_init(&mark->lock);
atomic_set(&mark->refcnt, 1); atomic_set(&mark->refcnt, 1);
INIT_HLIST_NODE(&mark->i.i_list);
mark->group = NULL;
mark->mask = 0;
mark->i.inode = NULL;
mark->free_mark = free_mark; mark->free_mark = free_mark;
} }
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