From 335f46b219c3843901482a1dbf49f72e048039f7 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 18 Oct 2025 22:24:06 +1100 Subject: [PATCH] libspl: move ptob() from zfs_context.h Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #17861 --- include/sys/zfs_context.h | 2 -- lib/libspl/include/os/freebsd/sys/param.h | 2 ++ lib/libspl/include/os/linux/sys/param.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index dac1e4b69..770cb73f2 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -203,8 +203,6 @@ extern char *vn_dumpdir; #define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1)) #define CPU_SEQID_UNSTABLE CPU_SEQID -#define ptob(x) ((x) * PAGESIZE) - #define NN_DIVISOR_1000 (1U << 0) #define NN_NUMBUF_SZ (6) diff --git a/lib/libspl/include/os/freebsd/sys/param.h b/lib/libspl/include/os/freebsd/sys/param.h index 55fa1de0e..a69314911 100644 --- a/lib/libspl/include/os/freebsd/sys/param.h +++ b/lib/libspl/include/os/freebsd/sys/param.h @@ -58,6 +58,8 @@ extern size_t spl_pagesize(void); #define PAGESIZE (spl_pagesize()) +#define ptob(x) ((x) * PAGESIZE) + #ifndef HAVE_EXECVPE extern int execvpe(const char *name, char * const argv[], char * const envp[]); #endif diff --git a/lib/libspl/include/os/linux/sys/param.h b/lib/libspl/include/os/linux/sys/param.h index 814f8feaf..169d5875f 100644 --- a/lib/libspl/include/os/linux/sys/param.h +++ b/lib/libspl/include/os/linux/sys/param.h @@ -65,4 +65,6 @@ extern size_t spl_pagesize(void); #define PAGESIZE (spl_pagesize()) +#define ptob(x) ((x) * PAGESIZE) + #endif