aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorMicha³ Miros³aw <mirq-linux@rere.qmqm.pl>2006-10-03 04:15:34 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:15 -0400
commite69fae561f422f7f9dbda19f448633aa6564663e (patch)
tree68ca8eb346741c3199549de38adc9fafd5db6c35 /drivers/md/dm-mpath.c
parent28f16c2039b4eefdc09c99b12f310afb44de5536 (diff)
[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.c17
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);
114 114
115static struct pgpath *alloc_pgpath(void) 115static struct pgpath *alloc_pgpath(void)
116{ 116{
117 struct pgpath *pgpath = kmalloc(sizeof(*pgpath), GFP_KERNEL); 117 struct pgpath *pgpath = kzalloc(sizeof(*pgpath), GFP_KERNEL);
118 118
119 if (pgpath) { 119 if (pgpath)
120 memset(pgpath, 0, sizeof(*pgpath));
121 pgpath->path.is_active = 1; 120 pgpath->path.is_active = 1;
122 }
123 121
124 return pgpath; 122 return pgpath;
125} 123}
@@ -133,12 +131,10 @@ static struct priority_group *alloc_priority_group(void)
133{ 131{
134 struct priority_group *pg; 132 struct priority_group *pg;
135 133
136 pg = kmalloc(sizeof(*pg), GFP_KERNEL); 134 pg = kzalloc(sizeof(*pg), GFP_KERNEL);
137 if (!pg)
138 return NULL;
139 135
140 memset(pg, 0, sizeof(*pg)); 136 if (pg)
141 INIT_LIST_HEAD(&pg->pgpaths); 137 INIT_LIST_HEAD(&pg->pgpaths);
142 138
143 return pg; 139 return pg;
144} 140}
@@ -172,9 +168,8 @@ static struct multipath *alloc_multipath(struct dm_target *ti)
172{ 168{
173 struct multipath *m; 169 struct multipath *m;
174 170
175 m = kmalloc(sizeof(*m), GFP_KERNEL); 171 m = kzalloc(sizeof(*m), GFP_KERNEL);
176 if (m) { 172 if (m) {
177 memset(m, 0, sizeof(*m));
178 INIT_LIST_HEAD(&m->priority_groups); 173 INIT_LIST_HEAD(&m->priority_groups);
179 spin_lock_init(&m->lock); 174 spin_lock_init(&m->lock);
180 m->queue_io = 1; 175 m->queue_io = 1;