Skip to content

Commit

Permalink
Factor Linux specific functionality out of libzutil
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Macy <[email protected]>
  • Loading branch information
mattmacy committed Sep 24, 2019
1 parent d359e99 commit b0ed9c5
Show file tree
Hide file tree
Showing 4 changed files with 1,568 additions and 1,469 deletions.
16 changes: 16 additions & 0 deletions include/libzutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ extern void zpool_dump_ddt(const ddt_stat_t *, const ddt_histogram_t *);
extern int zpool_history_unpack(char *, uint64_t, uint64_t *, nvlist_t ***,
uint_t *);

struct libpc_handle;
typedef struct libpc_handle libpc_handle_t;

extern int zutil_error(libpc_handle_t *hdl, const char *error, const char *msg);
extern void zutil_error_aux(libpc_handle_t *hdl, const char *fmt, ...);
extern int zutil_no_memory(libpc_handle_t *hdl);
extern void * zutil_alloc(libpc_handle_t *hdl, size_t size);
extern char *zutil_strdup(libpc_handle_t *hdl, const char *str);
extern int zutil_pool_active(libpc_handle_t *hdl, const char *name,
uint64_t guid, boolean_t *isactive);
extern nvlist_t *zutil_refresh_config(libpc_handle_t *hdl, nvlist_t *tryconfig);
extern int zutil_error_fmt(libpc_handle_t *hdl, const char *error,
const char *fmt, ...);

extern nvlist_t *zpool_find_import_impl(libpc_handle_t *hdl,
importargs_t *iarg);
#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 5 additions & 0 deletions lib/libzutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ USER_C = \
zutil_nicenum.c \
zutil_pool.c

if BUILD_LINUX
USER_C += \
os/linux/zutil_import_os.c
endif

nodist_libzutil_la_SOURCES = $(USER_C)

libzutil_la_LIBADD = \
Expand Down
Loading

0 comments on commit b0ed9c5

Please sign in to comment.