aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzpool
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2024-04-01 15:37:34 +1100
committerBrian Behlendorf <[email protected]>2024-08-21 13:37:18 -0700
commit5b9e69539249bb823de65c182dd225e8edaf408b (patch)
treefd6c5192b21469a43f480ef690ad1f96609a257a /lib/libzpool
parent7a5b4355e2e3b3cdedcc75300323db35c98e78df (diff)
abd_os: break out platform-specific header parts
Removing the platform #ifdefs from shared headers in favour of per-platform headers. Makes abd_t much leaner, among other things. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #16253
Diffstat (limited to 'lib/libzpool')
-rw-r--r--lib/libzpool/Makefile.am2
-rw-r--r--lib/libzpool/include/Makefile.am4
-rw-r--r--lib/libzpool/include/sys/abd_impl_os.h41
-rw-r--r--lib/libzpool/include/sys/abd_os.h47
4 files changed, 94 insertions, 0 deletions
diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am
index eb0dd0ace..6989fefc6 100644
--- a/lib/libzpool/Makefile.am
+++ b/lib/libzpool/Makefile.am
@@ -1,3 +1,5 @@
+include $(srcdir)/%D%/include/Makefile.am
+
libzpool_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS)
libzpool_la_CFLAGS += $(ZLIB_CFLAGS)
diff --git a/lib/libzpool/include/Makefile.am b/lib/libzpool/include/Makefile.am
new file mode 100644
index 000000000..2e0c4c561
--- /dev/null
+++ b/lib/libzpool/include/Makefile.am
@@ -0,0 +1,4 @@
+libzpooldir = $(includedir)/libzpool
+libzpool_HEADERS = \
+ %D%/sys/abd_os.h \
+ %D%/sys/abd_impl_os.h
diff --git a/lib/libzpool/include/sys/abd_impl_os.h b/lib/libzpool/include/sys/abd_impl_os.h
new file mode 100644
index 000000000..3137346f3
--- /dev/null
+++ b/lib/libzpool/include/sys/abd_impl_os.h
@@ -0,0 +1,41 @@
+/*
+ * 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 https://opensource.org/licenses/CDDL-1.0.
+ * 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 (c) 2014 by Chunwei Chen. All rights reserved.
+ * Copyright (c) 2016, 2019 by Delphix. All rights reserved.
+ * Copyright (c) 2023, 2024, Klara Inc.
+ */
+
+#ifndef _ABD_IMPL_OS_H
+#define _ABD_IMPL_OS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define abd_enter_critical(flags) ((void)0)
+#define abd_exit_critical(flags) ((void)0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ABD_IMPL_OS_H */
diff --git a/lib/libzpool/include/sys/abd_os.h b/lib/libzpool/include/sys/abd_os.h
new file mode 100644
index 000000000..67f7e5606
--- /dev/null
+++ b/lib/libzpool/include/sys/abd_os.h
@@ -0,0 +1,47 @@
+/*
+ * 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 https://opensource.org/licenses/CDDL-1.0.
+ * 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 (c) 2014 by Chunwei Chen. All rights reserved.
+ * Copyright (c) 2016, 2019 by Delphix. All rights reserved.
+ */
+
+#ifndef _ABD_OS_H
+#define _ABD_OS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct abd_scatter {
+ uint_t abd_offset;
+ uint_t abd_nents;
+ struct scatterlist *abd_sgl;
+};
+
+struct abd_linear {
+ void *abd_buf;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ABD_H */