Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert non-libzpool libraries to -fvisibility=hidden #12191

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions include/libnvpair.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

#ifndef _LIBNVPAIR_H
#define _LIBNVPAIR_H
#define _LIBNVPAIR_H extern __attribute__((visibility("default")))

#include <sys/nvpair.h>
#include <stdlib.h>
Expand All @@ -42,13 +42,13 @@ extern "C" {
* are all imported from <sys/nvpair.h> included above.
*/

extern int nvpair_value_match(nvpair_t *, int, char *, char **);
extern int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *,
_LIBNVPAIR_H int nvpair_value_match(nvpair_t *, int, char *, char **);
_LIBNVPAIR_H int nvpair_value_match_regex(nvpair_t *, int, char *, regex_t *,
char **);

extern void nvlist_print(FILE *, nvlist_t *);
int nvlist_print_json(FILE *, nvlist_t *);
extern void dump_nvlist(nvlist_t *, int);
_LIBNVPAIR_H void nvlist_print(FILE *, nvlist_t *);
_LIBNVPAIR_H int nvlist_print_json(FILE *, nvlist_t *);
_LIBNVPAIR_H void dump_nvlist(nvlist_t *, int);

/*
* Private nvlist printing interface that allows the caller some control
Expand Down Expand Up @@ -88,28 +88,29 @@ enum nvlist_indent_mode {
NVLIST_INDENT_TABBED /* Indent with tabstops */
};

extern nvlist_prtctl_t nvlist_prtctl_alloc(void);
extern void nvlist_prtctl_free(nvlist_prtctl_t);
extern void nvlist_prt(nvlist_t *, nvlist_prtctl_t);
_LIBNVPAIR_H nvlist_prtctl_t nvlist_prtctl_alloc(void);
_LIBNVPAIR_H void nvlist_prtctl_free(nvlist_prtctl_t);
_LIBNVPAIR_H void nvlist_prt(nvlist_t *, nvlist_prtctl_t);

/* Output stream */
extern void nvlist_prtctl_setdest(nvlist_prtctl_t, FILE *);
extern FILE *nvlist_prtctl_getdest(nvlist_prtctl_t);
_LIBNVPAIR_H void nvlist_prtctl_setdest(nvlist_prtctl_t, FILE *);
_LIBNVPAIR_H FILE *nvlist_prtctl_getdest(nvlist_prtctl_t);

/* Indentation mode, start indent, indent increment; default tabbed/0/1 */
extern void nvlist_prtctl_setindent(nvlist_prtctl_t, enum nvlist_indent_mode,
int, int);
extern void nvlist_prtctl_doindent(nvlist_prtctl_t, int);
_LIBNVPAIR_H void nvlist_prtctl_setindent(nvlist_prtctl_t,
enum nvlist_indent_mode, int, int);
_LIBNVPAIR_H void nvlist_prtctl_doindent(nvlist_prtctl_t, int);

enum nvlist_prtctl_fmt {
NVLIST_FMT_MEMBER_NAME, /* name fmt; default "%s = " */
NVLIST_FMT_MEMBER_POSTAMBLE, /* after nvlist member; default "\n" */
NVLIST_FMT_BTWN_ARRAY /* between array members; default " " */
};

extern void nvlist_prtctl_setfmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt,
_LIBNVPAIR_H void nvlist_prtctl_setfmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt,
const char *);
extern void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt, ...);
_LIBNVPAIR_H void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt,
...);

/*
* Function prototypes for interfaces that appoint a new rendering function
Expand Down Expand Up @@ -139,7 +140,7 @@ extern void nvlist_prtctl_dofmt(nvlist_prtctl_t, enum nvlist_prtctl_fmt, ...);
*/

#define NVLIST_PRINTCTL_SVDECL(funcname, valtype) \
extern void funcname(nvlist_prtctl_t, \
_LIBNVPAIR_H void funcname(nvlist_prtctl_t, \
int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, valtype), \
void *)

Expand Down Expand Up @@ -170,7 +171,7 @@ NVLIST_PRINTCTL_SVDECL(nvlist_prtctlop_nvlist, nvlist_t *);
* Return values as above.
*/
#define NVLIST_PRINTCTL_AVDECL(funcname, vtype) \
extern void funcname(nvlist_prtctl_t, \
_LIBNVPAIR_H void funcname(nvlist_prtctl_t, \
int (*)(nvlist_prtctl_t, void *, nvlist_t *, const char *, vtype, uint_t), \
void *)

Expand Down
130 changes: 68 additions & 62 deletions include/libzfs_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/

#ifndef _LIBZFS_CORE_H
#define _LIBZFS_CORE_H
#define _LIBZFS_CORE_H extern __attribute__((visibility("default")))

#include <libnvpair.h>
#include <sys/param.h>
Expand All @@ -38,41 +38,42 @@
extern "C" {
#endif

int libzfs_core_init(void);
void libzfs_core_fini(void);
_LIBZFS_CORE_H int libzfs_core_init(void);
_LIBZFS_CORE_H void libzfs_core_fini(void);

/*
* NB: this type should be kept binary compatible with dmu_objset_type_t.
* NB: this type should be kept binary-compatible with dmu_objset_type_t.
*/
enum lzc_dataset_type {
LZC_DATSET_TYPE_ZFS = 2,
LZC_DATSET_TYPE_ZVOL
};

int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *, uint8_t *,
_LIBZFS_CORE_H int lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_create(const char *, enum lzc_dataset_type, nvlist_t *,
uint8_t *, uint_t);
_LIBZFS_CORE_H int lzc_clone(const char *, const char *, nvlist_t *);
_LIBZFS_CORE_H int lzc_promote(const char *, char *, int);
_LIBZFS_CORE_H int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
_LIBZFS_CORE_H int lzc_bookmark(nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_get_bookmark_props(const char *, nvlist_t **);
_LIBZFS_CORE_H int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_load_key(const char *, boolean_t, uint8_t *, uint_t);
_LIBZFS_CORE_H int lzc_unload_key(const char *);
_LIBZFS_CORE_H int lzc_change_key(const char *, uint64_t, nvlist_t *, uint8_t *,
uint_t);
int lzc_clone(const char *, const char *, nvlist_t *);
int lzc_promote(const char *, char *, int);
int lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
int lzc_bookmark(nvlist_t *, nvlist_t **);
int lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
int lzc_get_bookmark_props(const char *, nvlist_t **);
int lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
int lzc_load_key(const char *, boolean_t, uint8_t *, uint_t);
int lzc_unload_key(const char *);
int lzc_change_key(const char *, uint64_t, nvlist_t *, uint8_t *, uint_t);
int lzc_initialize(const char *, pool_initialize_func_t, nvlist_t *,
nvlist_t **);
int lzc_trim(const char *, pool_trim_func_t, uint64_t, boolean_t,
_LIBZFS_CORE_H int lzc_initialize(const char *, pool_initialize_func_t,
nvlist_t *, nvlist_t **);
int lzc_redact(const char *, const char *, nvlist_t *);
_LIBZFS_CORE_H int lzc_trim(const char *, pool_trim_func_t, uint64_t, boolean_t,
nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_redact(const char *, const char *, nvlist_t *);

int lzc_snaprange_space(const char *, const char *, uint64_t *);
_LIBZFS_CORE_H int lzc_snaprange_space(const char *, const char *, uint64_t *);

int lzc_hold(nvlist_t *, int, nvlist_t **);
int lzc_release(nvlist_t *, nvlist_t **);
int lzc_get_holds(const char *, nvlist_t **);
_LIBZFS_CORE_H int lzc_hold(nvlist_t *, int, nvlist_t **);
_LIBZFS_CORE_H int lzc_release(nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_get_holds(const char *, nvlist_t **);

enum lzc_send_flags {
LZC_SEND_FLAG_EMBED_DATA = 1 << 0,
Expand All @@ -82,61 +83,66 @@ enum lzc_send_flags {
LZC_SEND_FLAG_SAVED = 1 << 4,
};

int lzc_send(const char *, const char *, int, enum lzc_send_flags);
int lzc_send_resume(const char *, const char *, int,
_LIBZFS_CORE_H int lzc_send(const char *, const char *, int,
enum lzc_send_flags);
_LIBZFS_CORE_H int lzc_send_resume(const char *, const char *, int,
enum lzc_send_flags, uint64_t, uint64_t);
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *);
_LIBZFS_CORE_H int lzc_send_space(const char *, const char *,
enum lzc_send_flags, uint64_t *);

struct dmu_replay_record;

int lzc_send_redacted(const char *, const char *, int, enum lzc_send_flags,
const char *);
int lzc_send_resume_redacted(const char *, const char *, int,
_LIBZFS_CORE_H int lzc_send_redacted(const char *, const char *, int,
enum lzc_send_flags, const char *);
_LIBZFS_CORE_H int lzc_send_resume_redacted(const char *, const char *, int,
enum lzc_send_flags, uint64_t, uint64_t, const char *);
int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, boolean_t,
int);
int lzc_receive_resumable(const char *, nvlist_t *, const char *, boolean_t,
boolean_t, int);
int lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t,
boolean_t, boolean_t, int, const struct dmu_replay_record *);
int lzc_receive_one(const char *, nvlist_t *, const char *, boolean_t,
boolean_t, boolean_t, int, const struct dmu_replay_record *, int,
_LIBZFS_CORE_H int lzc_receive(const char *, nvlist_t *, const char *,
boolean_t, boolean_t, int);
_LIBZFS_CORE_H int lzc_receive_resumable(const char *, nvlist_t *, const char *,
boolean_t, boolean_t, int);
_LIBZFS_CORE_H int lzc_receive_with_header(const char *, nvlist_t *,
const char *, boolean_t, boolean_t, boolean_t, int,
const struct dmu_replay_record *);
_LIBZFS_CORE_H int lzc_receive_one(const char *, nvlist_t *, const char *,
boolean_t, boolean_t, boolean_t, int, const struct dmu_replay_record *, int,
uint64_t *, uint64_t *, uint64_t *, nvlist_t **);
int lzc_receive_with_cmdprops(const char *, nvlist_t *, nvlist_t *,
uint8_t *, uint_t, const char *, boolean_t, boolean_t, boolean_t, int,
const struct dmu_replay_record *, int, uint64_t *, uint64_t *,
uint64_t *, nvlist_t **);
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *);
int lzc_send_space_resume_redacted(const char *, const char *,
_LIBZFS_CORE_H int lzc_receive_with_cmdprops(const char *, nvlist_t *,
nvlist_t *, uint8_t *, uint_t, const char *, boolean_t, boolean_t,
boolean_t, int, const struct dmu_replay_record *, int, uint64_t *,
uint64_t *, uint64_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_send_space(const char *, const char *,
enum lzc_send_flags, uint64_t *);
_LIBZFS_CORE_H int lzc_send_space_resume_redacted(const char *, const char *,
enum lzc_send_flags, uint64_t, uint64_t, uint64_t, const char *,
int, uint64_t *);
uint64_t lzc_send_progress(int);
_LIBZFS_CORE_H uint64_t lzc_send_progress(int);

boolean_t lzc_exists(const char *);
_LIBZFS_CORE_H boolean_t lzc_exists(const char *);

int lzc_rollback(const char *, char *, int);
int lzc_rollback_to(const char *, const char *);
_LIBZFS_CORE_H int lzc_rollback(const char *, char *, int);
_LIBZFS_CORE_H int lzc_rollback_to(const char *, const char *);

int lzc_rename(const char *, const char *);
int lzc_destroy(const char *);
_LIBZFS_CORE_H int lzc_rename(const char *, const char *);
_LIBZFS_CORE_H int lzc_destroy(const char *);

int lzc_channel_program(const char *, const char *, uint64_t,
uint64_t, nvlist_t *, nvlist_t **);
int lzc_channel_program_nosync(const char *, const char *, uint64_t,
_LIBZFS_CORE_H int lzc_channel_program(const char *, const char *, uint64_t,
uint64_t, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_channel_program_nosync(const char *, const char *,
uint64_t, uint64_t, nvlist_t *, nvlist_t **);

int lzc_sync(const char *, nvlist_t *, nvlist_t **);
int lzc_reopen(const char *, boolean_t);
_LIBZFS_CORE_H int lzc_sync(const char *, nvlist_t *, nvlist_t **);
_LIBZFS_CORE_H int lzc_reopen(const char *, boolean_t);

int lzc_pool_checkpoint(const char *);
int lzc_pool_checkpoint_discard(const char *);
_LIBZFS_CORE_H int lzc_pool_checkpoint(const char *);
_LIBZFS_CORE_H int lzc_pool_checkpoint_discard(const char *);

int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *);
int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *);
int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
_LIBZFS_CORE_H int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *);
_LIBZFS_CORE_H int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t,
boolean_t *);
_LIBZFS_CORE_H int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);

int lzc_set_bootenv(const char *, const nvlist_t *);
int lzc_get_bootenv(const char *, nvlist_t **);
_LIBZFS_CORE_H int lzc_set_bootenv(const char *, const nvlist_t *);
_LIBZFS_CORE_H int lzc_get_bootenv(const char *, nvlist_t **);
#ifdef __cplusplus
}
#endif
Expand Down
20 changes: 11 additions & 9 deletions include/libzfsbootenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#ifndef _LIBZFSBOOTENV_H
#define _LIBZFSBOOTENV_H
#define _LIBZFSBOOTENV_H extern __attribute__((visibility("default")))

#ifdef __cplusplus
extern "C" {
Expand All @@ -25,14 +25,16 @@ typedef enum lzbe_flags {
lzbe_replace /* replace current nvlist */
} lzbe_flags_t;

extern int lzbe_nvlist_get(const char *, const char *, void **);
extern int lzbe_nvlist_set(const char *, const char *, void *);
extern void lzbe_nvlist_free(void *);
extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t);
extern int lzbe_remove_pair(void *, const char *);
extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *);
extern int lzbe_get_boot_device(const char *, char **);
extern int lzbe_bootenv_print(const char *, const char *, FILE *);
_LIBZFSBOOTENV_H int lzbe_nvlist_get(const char *, const char *, void **);
_LIBZFSBOOTENV_H int lzbe_nvlist_set(const char *, const char *, void *);
_LIBZFSBOOTENV_H void lzbe_nvlist_free(void *);
_LIBZFSBOOTENV_H int lzbe_add_pair(void *, const char *, const char *, void *,
size_t);
_LIBZFSBOOTENV_H int lzbe_remove_pair(void *, const char *);
_LIBZFSBOOTENV_H int lzbe_set_boot_device(const char *, lzbe_flags_t,
const char *);
_LIBZFSBOOTENV_H int lzbe_get_boot_device(const char *, char **);
_LIBZFSBOOTENV_H int lzbe_bootenv_print(const char *, const char *, FILE *);

#ifdef __cplusplus
}
Expand Down
Loading