drbd: Convert vmalloc/memset to vzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Joe Perches 2011-05-28 10:36:24 -07:00 committed by Jiri Kosina
parent 3a816054fc
commit 57f3224c3f

View File

@ -378,15 +378,14 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
* thread. As we have no disk yet, we are not in the IO path, * thread. As we have no disk yet, we are not in the IO path,
* not even the IO path of the peer. */ * not even the IO path of the peer. */
bytes = sizeof(struct page *)*want; bytes = sizeof(struct page *)*want;
new_pages = kmalloc(bytes, GFP_KERNEL); new_pages = kzalloc(bytes, GFP_KERNEL);
if (!new_pages) { if (!new_pages) {
new_pages = vmalloc(bytes); new_pages = vzalloc(bytes);
if (!new_pages) if (!new_pages)
return NULL; return NULL;
vmalloced = 1; vmalloced = 1;
} }
memset(new_pages, 0, bytes);
if (want >= have) { if (want >= have) {
for (i = 0; i < have; i++) for (i = 0; i < have; i++)
new_pages[i] = old_pages[i]; new_pages[i] = old_pages[i];