Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Cast physmem to (...



details:   https://anonhg.NetBSD.org/src/rev/f28587ca5924
branches:  trunk
changeset: 748049:f28587ca5924
user:      haad <haad%NetBSD.org@localhost>
date:      Sun Oct 11 10:58:06 2009 +0000

description:
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.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/arc.c  |  4 +++-
 external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c |  4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 9a5d1f62b274 -r f28587ca5924 external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c  Sun Oct 11 10:56:13 2009 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c  Sun Oct 11 10:58:06 2009 +0000
@@ -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;
diff -r 9a5d1f62b274 -r f28587ca5924 external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c Sun Oct 11 10:56:13 2009 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c Sun Oct 11 10:58:06 2009 +0000
@@ -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:



Home | Main Index | Thread Index | Old Index