From eff621071ffd33764b833ea16894bee47d6ffb34 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Sat, 29 Aug 2020 18:43:26 +0000 Subject: FreeBSD: Simplify INGLOBALZONE FreeBSD's previous ZFS implemented INGLOBALZONE(thread) as (!jailed((thread)->td_ucred)) and passed curthread to INGLOBALZONE. We pass curproc instead of curthread, so we can achieve the same effect with (!jailed((proc)->p_ucred)). The implementation is trivial enough to fit on a single line in a define. We don't really need a whole separate function for something that's already macros all the way down. Eliminate in_globalzone. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10851 --- module/os/freebsd/spl/spl_zone.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'module') diff --git a/module/os/freebsd/spl/spl_zone.c b/module/os/freebsd/spl/spl_zone.c index 0b3b04d2a..bd3f019b2 100644 --- a/module/os/freebsd/spl/spl_zone.c +++ b/module/os/freebsd/spl/spl_zone.c @@ -242,12 +242,6 @@ zone_get_hostid(void *ptr) return ((uint32_t)curthread->td_ucred->cr_prison->pr_hostid); } -boolean_t -in_globalzone(struct proc *p) -{ - return (!jailed(FIRST_THREAD_IN_PROC((p))->td_ucred)); -} - static void zone_sysinit(void *arg __unused) { -- cgit v1.2.3