Module Name:    src
Committed By:   pooka
Date:           Sun Jan  9 14:12:38 UTC 2011

Modified Files:
        src/sys/rump/librump/rumpkern: rumpcopy.c

Log Message:
Shortcircuit remote 0-len copyin/out already in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpkern/rumpcopy.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/rumpkern/rumpcopy.c
diff -u src/sys/rump/librump/rumpkern/rumpcopy.c:1.14 src/sys/rump/librump/rumpkern/rumpcopy.c:1.15
--- src/sys/rump/librump/rumpkern/rumpcopy.c:1.14	Sun Jan  9 13:49:57 2011
+++ src/sys/rump/librump/rumpkern/rumpcopy.c	Sun Jan  9 14:12:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcopy.c,v 1.14 2011/01/09 13:49:57 pooka Exp $	*/
+/*	$NetBSD: rumpcopy.c,v 1.15 2011/01/09 14:12:37 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.14 2011/01/09 13:49:57 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.15 2011/01/09 14:12:37 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/lwp.h>
@@ -48,7 +48,7 @@
 
 	if (curproc->p_vmspace == vmspace_kernel()) {
 		memcpy(kaddr, uaddr, len);
-	} else {
+	} else if (len) {
 		error = rumpuser_sp_copyin(curproc->p_vmspace->vm_map.pmap,
 		    uaddr, kaddr, len);
 	}
@@ -67,7 +67,7 @@
 
 	if (curproc->p_vmspace == vmspace_kernel()) {
 		memcpy(uaddr, kaddr, len);
-	} else {
+	} else if (len) {
 		error = rumpuser_sp_copyout(curproc->p_vmspace->vm_map.pmap,
 		    kaddr, uaddr, len);
 	}

Reply via email to