File tree Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ extern "C" {
127127#include <sys/kmem.h>
128128#include <sys/zfs_delay.h>
129129#include <sys/vnode.h>
130+ #include <sys/random.h>
131+ #include <sys/callb.h>
132+ #include <sys/trace.h>
133+ #include <sys/systm.h>
130134
131135#include <sys/zfs_context_os.h>
132136
@@ -206,7 +210,6 @@ extern char *vn_dumpdir;
206210#define NN_DIVISOR_1000 (1U << 0)
207211#define NN_NUMBUF_SZ (6)
208212
209- extern uint64_t physmem ;
210213extern const char * random_path ;
211214extern const char * urandom_path ;
212215
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ libspl_sys_HEADERS = \
5959 %D%/sys/string.h \
6060 %D%/sys/sunddi.h \
6161 %D%/sys/systeminfo.h \
62+ %D%/sys/systm.h \
6263 %D%/sys/thread.h \
6364 %D%/sys/taskq.h \
6465 %D%/sys/time.h \
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: CDDL-1.0
2+ /*
3+ * CDDL HEADER START
4+ *
5+ * The contents of this file are subject to the terms of the
6+ * Common Development and Distribution License (the "License").
7+ * You may not use this file except in compliance with the License.
8+ *
9+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10+ * or https://opensource.org/licenses/CDDL-1.0.
11+ * See the License for the specific language governing permissions
12+ * and limitations under the License.
13+ *
14+ * When distributing Covered Code, include this CDDL HEADER in each
15+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16+ * If applicable, add the following below this CDDL HEADER, with the
17+ * fields enclosed by brackets "[]" replaced with your own identifying
18+ * information: Portions Copyright [yyyy] [name of copyright owner]
19+ *
20+ * CDDL HEADER END
21+ */
22+ /*
23+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
26+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27+ */
28+
29+ #ifndef _LIBSPL_SYS_SYSTM_H
30+ #define _LIBSPL_SYS_SYSTM_H
31+
32+ extern uint64_t physmem ;
33+
34+ #endif
Original file line number Diff line number Diff line change 2020 * CDDL HEADER END
2121 */
2222/*
23+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
25+ * Copyright (c) 2016 Actifio, Inc. All rights reserved.
26+ * Copyright (c) 2025, Klara, Inc.
2327 * Copyright (c) 2025, Rob Norris <[email protected] > 2428 */
2529
2630#include <libspl.h>
31+ #include <unistd.h>
32+
33+ uint64_t physmem ;
2734
2835void
2936libspl_init (void )
3037{
38+ physmem = sysconf (_SC_PHYS_PAGES );
3139}
3240
3341void
Original file line number Diff line number Diff line change 6060 * Emulation of kernel services in userland.
6161 */
6262
63- uint64_t physmem ;
6463uint32_t hostid ;
6564struct utsname hw_utsname ;
6665
@@ -509,8 +508,6 @@ kernel_init(int mode)
509508
510509 umem_nofail_callback (umem_out_of_memory );
511510
512- physmem = sysconf (_SC_PHYS_PAGES );
513-
514511 dprintf ("physmem = %llu pages (%.2f GB)\n" , (u_longlong_t )physmem ,
515512 (double )physmem * sysconf (_SC_PAGE_SIZE ) / (1ULL << 30 ));
516513
You can’t perform that action at this time.
0 commit comments