diff --git a/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c b/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c index c8d95e6648d3..f49b256e23cb 100644 --- a/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c +++ b/external/cddl/osnet/dist/uts/common/fs/zfs/arc.c @@ -135,7 +135,9 @@ #ifdef __NetBSD__ #include +#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 @@ buf_init(void) * 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 --git a/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c b/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c index fb7ae51bd8ac..11187b071db6 100644 --- a/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c +++ b/external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c @@ -237,13 +237,13 @@ dbuf_init(void) 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: