From 4b13e9707af18ff418f30b073aad32a35f2e0270 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Wed, 18 Oct 2023 16:17:36 +0900 Subject: [PATCH] Compile fixes for rebase ASSERT0P set active allocator Signed-off-by: Jorgen Lundman --- include/os/windows/spl/sys/debug.h | 3 +++ include/os/windows/zfs/zfs_config.h | 2 ++ module/os/windows/zfs/sysctl_os.c | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/include/os/windows/spl/sys/debug.h b/include/os/windows/spl/sys/debug.h index 86a72df1e2bf..48c43d8a83bc 100644 --- a/include/os/windows/spl/sys/debug.h +++ b/include/os/windows/spl/sys/debug.h @@ -169,6 +169,7 @@ extern void printBuffer(const char *fmt, ...); #define ASSERT3S(x, y, z) VERIFY3S(x, y, z) #define ASSERT3U(x, y, z) VERIFY3U(x, y, z) #define ASSERT3P(x, y, z) VERIFY3P(x, y, z) +#define ASSERT0P(x) VERIFY0P(x) #define ASSERT0(x) VERIFY0(x) #define ASSERTV(x) x @@ -190,6 +191,7 @@ extern void printBuffer(const char *fmt, ...); #define ASSERT3S(x, y, z) ((void)0) #define ASSERT3U(x, y, z) ((void)0) #define ASSERT3P(x, y, z) ((void)0) +#define ASSERT0P(x) ((void)0) #define ASSERT0(x) ((void)0) #endif /* DBG */ @@ -210,6 +212,7 @@ extern void printBuffer(const char *fmt, ...); #define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t, "%llu", \ (unsigned long long)) #define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t, "%p", (void *)) +#define VERIFY0P(x) VERIFY3_IMPL(0, ==, x, uintptr_t, "%p", (void *)) #define VERIFY0(x) VERIFY3_IMPL(0, ==, x, int64_t, "%lld", (long long)) #define VERIFY(EX) do { \ diff --git a/include/os/windows/zfs/zfs_config.h b/include/os/windows/zfs/zfs_config.h index d1b08be6a3c1..9634b074830f 100644 --- a/include/os/windows/zfs/zfs_config.h +++ b/include/os/windows/zfs/zfs_config.h @@ -150,3 +150,5 @@ /* Define the project alias string. */ #define ZFS_META_ALIAS ZFS_META_GITREV + +#define ZFSEXECDIR "C:/Program Files/OpenZFS on Windows" diff --git a/module/os/windows/zfs/sysctl_os.c b/module/os/windows/zfs/sysctl_os.c index 9951919b40bd..62a7dcc2eaf5 100644 --- a/module/os/windows/zfs/sysctl_os.c +++ b/module/os/windows/zfs/sysctl_os.c @@ -564,6 +564,26 @@ param_set_arc_int(ZFS_MODULE_PARAM_ARGS) /* dsl_scan.c */ /* metaslab.c */ +int +param_set_active_allocator(ZFS_MODULE_PARAM_ARGS) +{ + char buf[16]; + + *type = ZT_TYPE_STRING; + + if (set == B_FALSE) { + *ptr = (void *)zfs_active_allocator; + *len = strlen(zfs_active_allocator) + 1; + return (0); + } + + strlcpy(buf, *ptr, sizeof (buf)); + + if (strcmp(buf, zfs_active_allocator) == 0) + return (0); + + return (-param_set_active_allocator_common(buf)); +} /* spa_misc.c */ extern int zfs_flags;