Module Name: src
Committed By: pooka
Date: Mon Sep 6 17:32:38 UTC 2010
Modified Files:
src/sys/rump/librump/rumpvfs: vm_vfs.c
Log Message:
simplify and fix len-to-npages calculation
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.18
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.17 Thu Aug 19 02:07:11 2010
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c Mon Sep 6 17:32:38 2010
@@ -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,