Module Name: src
Committed By: pooka
Date: Wed Dec 16 16:50:49 UTC 2009
Modified Files:
src/sys/rump/librump/rumpvfs: vm_vfs.c
Log Message:
If zeroing len == 0, return immediately.
(kmem_alloc() doesn't like being called with size == 0)
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpvfs/vm_vfs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/librump/rumpvfs/vm_vfs.c
diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.14 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.15
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.14 Tue Nov 10 16:55:12 2009
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c Wed Dec 16 16:50:49 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_vfs.c,v 1.14 2009/11/10 16:55:12 pooka Exp $ */
+/* $NetBSD: vm_vfs.c,v 1.15 2009/12/16 16:50:49 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.14 2009/11/10 16:55:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.15 2009/12/16 16:50:49 pooka Exp $");
#include <sys/param.h>
@@ -91,6 +91,9 @@
int maxpages = MIN(32, round_page(len) >> PAGE_SHIFT);
int rv, npages, i;
+ if (maxpages == 0)
+ return;
+
pgs = kmem_zalloc(maxpages * sizeof(pgs), KM_SLEEP);
while (len) {
npages = MIN(maxpages, round_page(len) >> PAGE_SHIFT);