diff options
author | Joe Perches <joe@perches.com> | 2011-08-02 12:32:02 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-08-02 12:32:02 +0100 |
commit | e29e65aacbd9e628378084905cbcf62a9fa4a8cc (patch) | |
tree | 279e6e87d60da82c082833205c996d7046b1a46d /drivers | |
parent | 6c9b27ab08aaf46426515b8b858ad9c60731c7a1 (diff) | |
download | op-kernel-dev-e29e65aacbd9e628378084905cbcf62a9fa4a8cc.zip op-kernel-dev-e29e65aacbd9e628378084905cbcf62a9fa4a8cc.tar.gz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-log.c | 3 | ||||
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 3 | ||||
-rw-r--r-- | drivers/md/dm-table.c | 4 |
3 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 306ce12..3b52bb7 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -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; diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 39becbe..1a0acb8 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -174,10 +174,9 @@ static int alloc_area(struct pstore *ps) if (!ps->area) goto err_area; - ps->zero_area = vmalloc(len); + ps->zero_area = vzalloc(len); if (!ps->zero_area) goto err_zero_area; - memset(ps->zero_area, 0, len); ps->header_area = vmalloc(len); if (!ps->header_area) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 3909fa2..8dc6755 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -153,9 +153,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size) return NULL; size = nmemb * elem_size; - addr = vmalloc(size); - if (addr) - memset(addr, 0, size); + addr = vzalloc(size); return addr; } |