Skip to content

Commit

Permalink
abd_os: split userspace and Linux kernel code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robn authored and behlendorf committed Aug 21, 2024
1 parent 2b7d9a7 commit 7a5b435
Show file tree
Hide file tree
Showing 4 changed files with 498 additions and 149 deletions.
2 changes: 2 additions & 0 deletions include/sys/abd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/libzpool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lib_LTLIBRARIES += libzpool.la
CPPCHECKTARGETS += libzpool.la

dist_libzpool_la_SOURCES = \
%D%/abd_os.c \
%D%/kernel.c \
%D%/taskq.c \
%D%/util.c
Expand Down Expand Up @@ -39,7 +40,6 @@ nodist_libzpool_la_SOURCES = \
module/lua/lvm.c \
module/lua/lzio.c \
\
module/os/linux/zfs/abd_os.c \
module/os/linux/zfs/arc_os.c \
module/os/linux/zfs/trace.c \
module/os/linux/zfs/vdev_file.c \
Expand Down
Loading

0 comments on commit 7a5b435

Please sign in to comment.