dm: use vzalloc
Use vzalloc() instead of vmalloc()+memset(). Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:

committed by
Alasdair G Kergon

parent
6c9b27ab08
commit
e29e65aacb
@@ -492,7 +492,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
|
||||
memset(lc->sync_bits, (sync == NOSYNC) ? -1 : 0, bitset_size);
|
||||
lc->sync_count = (sync == NOSYNC) ? region_count : 0;
|
||||
|
||||
lc->recovering_bits = vmalloc(bitset_size);
|
||||
lc->recovering_bits = vzalloc(bitset_size);
|
||||
if (!lc->recovering_bits) {
|
||||
DMWARN("couldn't allocate sync bitset");
|
||||
vfree(lc->sync_bits);
|
||||
@@ -504,7 +504,6 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
|
||||
kfree(lc);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(lc->recovering_bits, 0, bitset_size);
|
||||
lc->sync_search = 0;
|
||||
log->context = lc;
|
||||
|
||||
|
Reference in New Issue
Block a user