aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-17 21:24:27 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:57 -0400
commitba643f04cdda170215c8820acd3e201936fc512d (patch)
treead871aa57096cd228f666405f370170f70b26968
parent5444e2981c31d0ed7465475e451b8437084337e5 (diff)
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: Eric Paris <eparis@redhat.com>
-rw-r--r--fs/notify/mark.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index e56e8768d676..57bb1d74a2b6 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -284,11 +284,8 @@ void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *ol
284void fsnotify_init_mark(struct fsnotify_mark *mark, 284void fsnotify_init_mark(struct fsnotify_mark *mark,
285 void (*free_mark)(struct fsnotify_mark *mark)) 285 void (*free_mark)(struct fsnotify_mark *mark))
286{ 286{
287 memset(mark, 0, sizeof(*mark));
287 spin_lock_init(&mark->lock); 288 spin_lock_init(&mark->lock);
288 atomic_set(&mark->refcnt, 1); 289 atomic_set(&mark->refcnt, 1);
289 INIT_HLIST_NODE(&mark->i.i_list);
290 mark->group = NULL;
291 mark->mask = 0;
292 mark->i.inode = NULL;
293 mark->free_mark = free_mark; 290 mark->free_mark = free_mark;
294} 291}