summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-18 02:12:07 +0100
committerEric Paris <eparis@redhat.com>2010-07-28 15:58:20 +0200
commit6f3a539e3bd8ed2eafa532443723d56896153a00 (patch)
tree73c85129825daf947c32c2e1f6e9e97ed674b108 /fs
parentfsnotify: kzalloc fsnotify groups (diff)
downloadlinux-6f3a539e3bd8ed2eafa532443723d56896153a00.tar.xz
linux-6f3a539e3bd8ed2eafa532443723d56896153a00.zip
fsnotify: use kmem_cache_zalloc to simplify event initialization
fsnotify event initialization is done entry by entry with almost everything set to either 0 or NULL. Use kmem_cache_zalloc and only initialize things that need non-zero initialization. Also means we don't have to change initialization entries based on the config options. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/notify/notification.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 8481253d64b5..b34ce7ad0409 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -314,25 +314,14 @@ void fsnotify_flush_notify(struct fsnotify_group *group)
static void initialize_event(struct fsnotify_event *event)
{
- event->holder.event = NULL;
INIT_LIST_HEAD(&event->holder.event_list);
atomic_set(&event->refcnt, 1);
spin_lock_init(&event->lock);
- event->path.dentry = NULL;
- event->path.mnt = NULL;
- event->inode = NULL;
event->data_type = FSNOTIFY_EVENT_NONE;
INIT_LIST_HEAD(&event->private_data_list);
-
- event->to_tell = NULL;
-
- event->file_name = NULL;
- event->name_len = 0;
-
- event->sync_cookie = 0;
}
/*
@@ -353,7 +342,7 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
{
struct fsnotify_event *event;
- event = kmem_cache_alloc(fsnotify_event_cachep, gfp);
+ event = kmem_cache_zalloc(fsnotify_event_cachep, gfp);
if (!event)
return NULL;