aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libspl/os/linux
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-08-30 17:37:44 +0000
committerBrian Behlendorf <[email protected]>2020-08-31 19:43:30 -0700
commit46b7d53baf1c17f006a0ff6a8efb01e48ac248bf (patch)
treefed42666da7d08cea7e780677412d4245d30696d /lib/libspl/os/linux
parenteff621071ffd33764b833ea16894bee47d6ffb34 (diff)
libspl: Provide platform-specific zone implementations
FreeBSD has the concept of jails, a precursor to Solaris's zones, which can be mapped to the required zones interface with relative ease. The previous ZFS implementation in FreeBSD did so, and we should continue to provide an appropriate implementation in OpenZFS as well. Move lib/libspl/zone.c into platform code and adopt the correct implementation for FreeBSD. While here, prune unused code. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10851
Diffstat (limited to 'lib/libspl/os/linux')
-rw-r--r--lib/libspl/os/linux/zone.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/libspl/os/linux/zone.c b/lib/libspl/os/linux/zone.c
new file mode 100644
index 000000000..a71c4e0b2
--- /dev/null
+++ b/lib/libspl/os/linux/zone.c
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2006 Ricardo Correia. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <zone.h>
+
+zoneid_t
+getzoneid()
+{
+ return (GLOBAL_ZONEID);
+}