Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpvfs If zeroing len == 0, return immedia...
details: https://anonhg.NetBSD.org/src/rev/af4772799ec8
branches: trunk
changeset: 750097:af4772799ec8
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Dec 16 16:50:49 2009 +0000
description:
If zeroing len == 0, return immediately.
(kmem_alloc() doesn't like being called with size == 0)
diffstat:
sys/rump/librump/rumpvfs/vm_vfs.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 625cfd931116 -r af4772799ec8 sys/rump/librump/rumpvfs/vm_vfs.c
--- a/sys/rump/librump/rumpvfs/vm_vfs.c Wed Dec 16 16:03:26 2009 +0000
+++ b/sys/rump/librump/rumpvfs/vm_vfs.c Wed Dec 16 16:50:49 2009 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index