Module Name: src
Committed By: haad
Date: Sun Oct 11 10:58:06 UTC 2009
Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: arc.c dbuf.c
Log Message:
Cast physmem to (uint64_t) so it works on a amd64 system with more than 4Gb ram.
undef btop if it was already included from other NetBSD header file.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.4 src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.5
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c:1.4 Wed Aug 12 21:52:41 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c Sun Oct 11 10:58:06 2009
@@ -135,7 +135,9 @@
#ifdef __NetBSD__
#include <uvm/uvm.h>
+#ifndef btop
#define btop(x) ((x) / PAGE_SIZE)
+#endif
#define needfree (uvmexp.free < uvmexp.freetarg ? uvmexp.freetarg : 0)
#define buf_init arc_buf_init
#define freemem uvmexp.free
@@ -867,7 +869,7 @@
* with an average 64K block size. The table will take up
* totalmem*sizeof(void*)/64K (eg. 128KB/GB with 8-byte pointers).
*/
- while (hsize * 65536 < physmem * PAGESIZE)
+ while (hsize * 65536 < (uint64_t)physmem * PAGESIZE)
hsize <<= 1;
retry:
buf_hash_table.ht_mask = hsize - 1;
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c:1.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c:1.2 Fri Aug 7 20:16:45 2009
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c Sun Oct 11 10:58:06 2009
@@ -237,13 +237,13 @@
uint64_t hsize = 1ULL << 16;
dbuf_hash_table_t *h = &dbuf_hash_table;
int i;
-
+
/*
* The hash table is big enough to fill all of physical memory
* with an average 4K block size. The table will take up
* totalmem*sizeof(void*)/4K (i.e. 2MB/GB with 8-byte pointers).
*/
- while (hsize * 4096 < physmem * PAGESIZE)
+ while (hsize * 4096 < (uint64_t)physmem * PAGESIZE)
hsize <<= 1;
retry: