Commit e69fae56 authored by Micha³ Miros³aw's avatar Micha³ Miros³aw Committed by Linus Torvalds

[PATCH] dm mpath: use kzalloc

Use kzalloc() instead of kmalloc() + memset().
Signed-off-by: default avatarMicha³ Miros³aw <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 28f16c20
...@@ -114,12 +114,10 @@ static void trigger_event(void *data); ...@@ -114,12 +114,10 @@ static void trigger_event(void *data);
static struct pgpath *alloc_pgpath(void) static struct pgpath *alloc_pgpath(void)
{ {
struct pgpath *pgpath = kmalloc(sizeof(*pgpath), GFP_KERNEL); struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
if (pgpath) { if (pgpath)
memset(pgpath, 0, sizeof(*pgpath));
pgpath->path.is_active = 1; pgpath->path.is_active = 1;
}
return pgpath; return pgpath;
} }
...@@ -133,11 +131,9 @@ static struct priority_group *alloc_priority_group(void) ...@@ -133,11 +131,9 @@ static struct priority_group *alloc_priority_group(void)
{ {
struct priority_group *pg; struct priority_group *pg;
pg = kmalloc(sizeof(*pg), GFP_KERNEL); pg = kzalloc(sizeof(*pg), GFP_KERNEL);
if (!pg)
return NULL;
memset(pg, 0, sizeof(*pg)); if (pg)
INIT_LIST_HEAD(&pg->pgpaths); INIT_LIST_HEAD(&pg->pgpaths);
return pg; return pg;
...@@ -172,9 +168,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti) ...@@ -172,9 +168,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti)
{ {
struct multipath *m; struct multipath *m;
m = kmalloc(sizeof(*m), GFP_KERNEL); m = kzalloc(sizeof(*m), GFP_KERNEL);
if (m) { if (m) {
memset(m, 0, sizeof(*m));
INIT_LIST_HEAD(&m->priority_groups); INIT_LIST_HEAD(&m->priority_groups);
spin_lock_init(&m->lock); spin_lock_init(&m->lock);
m->queue_io = 1; m->queue_io = 1;
......
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