abd_os: split userspace and Linux kernel code

The Linux abd_os.c serves double-duty as the userspace scatter abd
implementation, by carrying an emulation of kernel scatterlists. This
commit lifts common and userspace-specific parts out into a separate
abd_os.c for libzpool.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16253
This commit is contained in:
Rob Norris
2023-12-25 22:25:48 +11:00
committed by Brian Behlendorf
parent 2b7d9a7863
commit 7a5b4355e2
4 changed files with 498 additions and 149 deletions
+2
View File
@@ -68,7 +68,9 @@ typedef struct abd {
} abd_scatter;
struct abd_linear {
void *abd_buf;
#if defined(__linux__) && defined(_KERNEL)
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */
#endif
} abd_linear;
struct abd_gang {
list_t abd_gang_chain;