Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256Ab0KEDQt (ORCPT ); Thu, 4 Nov 2010 23:16:49 -0400 Received: from mail.perches.com ([173.55.12.10]:4035 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580Ab0KEDIp (ORCPT ); Thu, 4 Nov 2010 23:08:45 -0400 From: Joe Perches To: Jiri Kosina Cc: Neil Brown , dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/49] drivers/md: Use vzalloc Date: Thu, 4 Nov 2010 20:07:38 -0700 Message-Id: X-Mailer: git-send-email 1.7.3.1.g432b3.dirty In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2147 Lines: 67 Signed-off-by: Joe Perches --- drivers/md/dm-log.c | 3 +-- drivers/md/dm-snap-persistent.c | 3 +-- 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 33420e6..8f00e38 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -487,7 +487,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); @@ -499,7 +499,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 2129cdb..8eb943f 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 90267f8..d6a91f7 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -151,9 +151,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; } -- 1.7.3.1.g432b3.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/