diff options
author | Micha³ Miros³aw <mirq-linux@rere.qmqm.pl> | 2006-10-03 01:15:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 08:04:15 -0700 |
commit | e69fae561f422f7f9dbda19f448633aa6564663e (patch) | |
tree | 68ca8eb346741c3199549de38adc9fafd5db6c35 /drivers/md/dm-mpath.c | |
parent | 28f16c2039b4eefdc09c99b12f310afb44de5536 (diff) | |
download | blackbird-op-linux-e69fae561f422f7f9dbda19f448633aa6564663e.tar.gz blackbird-op-linux-e69fae561f422f7f9dbda19f448633aa6564663e.zip |
[PATCH] dm mpath: use kzalloc
Use kzalloc() instead of kmalloc() + memset().
Signed-off-by: Micha³ Miros³aw <mirq-linux@rere.qmqm.pl>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d1dc72c0f98a..d754e0bc6e90 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -114,12 +114,10 @@ static void trigger_event(void *data); static struct pgpath *alloc_pgpath(void) { - struct pgpath *pgpath = kmalloc(sizeof(*pgpath), GFP_KERNEL); + struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL); - if (pgpath) { - memset(pgpath, 0, sizeof(*pgpath)); + if (pgpath) pgpath->path.is_active = 1; - } return pgpath; } @@ -133,12 +131,10 @@ static struct priority_group *alloc_priority_group(void) { struct priority_group *pg; - pg = kmalloc(sizeof(*pg), GFP_KERNEL); - if (!pg) - return NULL; + pg = kzalloc(sizeof(*pg), GFP_KERNEL); - memset(pg, 0, sizeof(*pg)); - INIT_LIST_HEAD(&pg->pgpaths); + if (pg) + INIT_LIST_HEAD(&pg->pgpaths); return pg; } @@ -172,9 +168,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti) { struct multipath *m; - m = kmalloc(sizeof(*m), GFP_KERNEL); + m = kzalloc(sizeof(*m), GFP_KERNEL); if (m) { - memset(m, 0, sizeof(*m)); INIT_LIST_HEAD(&m->priority_groups); spin_lock_init(&m->lock); m->queue_io = 1; |