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 simplify and fix len-to-npages calc...



details:   https://anonhg.NetBSD.org/src/rev/860b6070b923
branches:  trunk
changeset: 757581:860b6070b923
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Sep 06 17:32:38 2010 +0000

description:
simplify and fix len-to-npages calculation

diffstat:

 sys/rump/librump/rumpvfs/vm_vfs.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r a007a9c2ca13 -r 860b6070b923 sys/rump/librump/rumpvfs/vm_vfs.c
--- a/sys/rump/librump/rumpvfs/vm_vfs.c Mon Sep 06 16:03:56 2010 +0000
+++ b/sys/rump/librump/rumpvfs/vm_vfs.c Mon Sep 06 17:32:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_vfs.c,v 1.17 2010/08/19 02:07:11 pooka Exp $        */
+/*     $NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 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.17 2010/08/19 02:07:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 pooka Exp $");
 
 #include <sys/param.h>
 
@@ -132,10 +132,8 @@
        return;
 }
 
-/* dumdidumdum */
 #define len2npages(off, len)                                           \
-  (((((len) + PAGE_MASK) & ~(PAGE_MASK)) >> PAGE_SHIFT)                        \
-    + (((off & PAGE_MASK) + (len & PAGE_MASK)) > PAGE_SIZE))
+    ((round_page(off+len) - trunc_page(off)) >> PAGE_SHIFT)
 
 int
 ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t todo,



Home | Main Index | Thread Index | Old Index