Skip to content

Commit 7a5b435

Browse files
robnbehlendorf
authored andcommitted
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #16253
1 parent 2b7d9a7 commit 7a5b435

File tree

4 files changed

+498
-149
lines changed

4 files changed

+498
-149
lines changed

include/sys/abd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ typedef struct abd {
6868
} abd_scatter;
6969
struct abd_linear {
7070
void *abd_buf;
71+
#if defined(__linux__) && defined(_KERNEL)
7172
struct scatterlist *abd_sgl; /* for LINEAR_PAGE */
73+
#endif
7274
} abd_linear;
7375
struct abd_gang {
7476
list_t abd_gang_chain;

lib/libzpool/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lib_LTLIBRARIES += libzpool.la
99
CPPCHECKTARGETS += libzpool.la
1010

1111
dist_libzpool_la_SOURCES = \
12+
%D%/abd_os.c \
1213
%D%/kernel.c \
1314
%D%/taskq.c \
1415
%D%/util.c
@@ -39,7 +40,6 @@ nodist_libzpool_la_SOURCES = \
3940
module/lua/lvm.c \
4041
module/lua/lzio.c \
4142
\
42-
module/os/linux/zfs/abd_os.c \
4343
module/os/linux/zfs/arc_os.c \
4444
module/os/linux/zfs/trace.c \
4545
module/os/linux/zfs/vdev_file.c \

0 commit comments

Comments
 (0)