2025-01-04 11:04:27 +11:00
|
|
|
// SPDX-License-Identifier: CDDL-1.0
|
2013-08-28 06:45:09 -05:00
|
|
|
/*
|
|
|
|
|
* CDDL HEADER START
|
|
|
|
|
*
|
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
|
* Common Development and Distribution License (the "License").
|
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
|
*
|
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-11 23:16:13 +02:00
|
|
|
* or https://opensource.org/licenses/CDDL-1.0.
|
2013-08-28 06:45:09 -05:00
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
|
* and limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
|
*
|
|
|
|
|
* CDDL HEADER END
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
2020-05-07 09:36:33 -07:00
|
|
|
* Copyright (c) 2012, 2020 by Delphix. All rights reserved.
|
2017-06-26 16:56:09 -07:00
|
|
|
* Copyright 2017 RackTop Systems.
|
2017-10-26 21:26:09 +02:00
|
|
|
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
2022-07-28 18:52:46 -04:00
|
|
|
* Copyright (c) 2019 Datto Inc.
|
2013-08-28 06:45:09 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _LIBZFS_CORE_H
|
2021-06-03 23:50:07 +02:00
|
|
|
#define _LIBZFS_CORE_H extern __attribute__((visibility("default")))
|
2013-08-28 06:45:09 -05:00
|
|
|
|
|
|
|
|
#include <libnvpair.h>
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/fs/zfs.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int libzfs_core_init(void);
|
|
|
|
|
_LIBZFS_CORE_H void libzfs_core_fini(void);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-10-07 10:31:26 -07:00
|
|
|
struct zfs_cmd;
|
|
|
|
|
_LIBZFS_CORE_H int lzc_ioctl_fd(int, unsigned long, struct zfs_cmd *);
|
|
|
|
|
|
2017-01-23 20:49:57 +03:00
|
|
|
/*
|
2021-06-03 23:50:07 +02:00
|
|
|
* NB: this type should be kept binary-compatible with dmu_objset_type_t.
|
2017-01-23 20:49:57 +03:00
|
|
|
*/
|
|
|
|
|
enum lzc_dataset_type {
|
|
|
|
|
LZC_DATSET_TYPE_ZFS = 2,
|
|
|
|
|
LZC_DATSET_TYPE_ZVOL
|
|
|
|
|
};
|
|
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 *,
|
2017-08-14 13:36:48 -04:00
|
|
|
uint_t);
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_initialize(const char *, pool_initialize_func_t,
|
2019-03-29 09:13:20 -07:00
|
|
|
nvlist_t *, nvlist_t **);
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 *);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_snaprange_space(const char *, const char *, uint64_t *);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 **);
|
2024-06-04 04:28:43 +05:00
|
|
|
_LIBZFS_CORE_H int lzc_get_props(const char *, nvlist_t **);
|
2013-09-04 07:00:57 -05:00
|
|
|
|
2014-06-05 13:19:08 -08:00
|
|
|
enum lzc_send_flags {
|
2014-11-03 12:15:08 -08:00
|
|
|
LZC_SEND_FLAG_EMBED_DATA = 1 << 0,
|
2016-07-11 13:45:52 -04:00
|
|
|
LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1,
|
2017-08-14 13:36:48 -04:00
|
|
|
LZC_SEND_FLAG_COMPRESS = 1 << 2,
|
|
|
|
|
LZC_SEND_FLAG_RAW = 1 << 3,
|
2020-01-10 13:16:58 -05:00
|
|
|
LZC_SEND_FLAG_SAVED = 1 << 4,
|
2014-06-05 13:19:08 -08:00
|
|
|
};
|
|
|
|
|
|
2022-02-21 02:31:32 +01:00
|
|
|
_LIBZFS_CORE_H int lzc_send_wrapper(int (*)(int, void *), int, void *);
|
2021-06-03 23:50:07 +02:00
|
|
|
_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,
|
2016-01-06 22:22:48 +01:00
|
|
|
enum lzc_send_flags, uint64_t, uint64_t);
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_send_space(const char *, const char *,
|
|
|
|
|
enum lzc_send_flags, uint64_t *);
|
2016-06-16 10:01:33 -07:00
|
|
|
|
|
|
|
|
struct dmu_replay_record;
|
|
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_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,
|
2019-06-19 09:48:13 -07:00
|
|
|
enum lzc_send_flags, uint64_t, uint64_t, const char *);
|
2021-06-03 23:50:07 +02:00
|
|
|
_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,
|
2017-08-14 13:36:48 -04:00
|
|
|
uint64_t *, uint64_t *, uint64_t *, nvlist_t **);
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 **);
|
2022-07-28 18:52:46 -04:00
|
|
|
_LIBZFS_CORE_H int lzc_receive_with_heal(const char *, nvlist_t *, nvlist_t *,
|
|
|
|
|
uint8_t *, uint_t, const char *, boolean_t, boolean_t, boolean_t, boolean_t,
|
|
|
|
|
int, const struct dmu_replay_record *, int, uint64_t *, uint64_t *,
|
|
|
|
|
uint64_t *, nvlist_t **);
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 *,
|
2019-06-19 09:48:13 -07:00
|
|
|
enum lzc_send_flags, uint64_t, uint64_t, uint64_t, const char *,
|
|
|
|
|
int, uint64_t *);
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H uint64_t lzc_send_progress(int);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H boolean_t lzc_exists(const char *);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_rollback(const char *, char *, int);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_rollback_to(const char *, const char *);
|
2013-08-28 06:45:09 -05:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_rename(const char *, const char *);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_destroy(const char *);
|
2018-06-28 00:37:54 +03:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_channel_program(const char *, const char *, uint64_t,
|
2018-02-08 09:35:09 -07:00
|
|
|
uint64_t, nvlist_t *, nvlist_t **);
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_channel_program_nosync(const char *, const char *,
|
|
|
|
|
uint64_t, uint64_t, nvlist_t *, nvlist_t **);
|
2018-02-08 09:16:23 -07:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_sync(const char *, nvlist_t *, nvlist_t **);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_reopen(const char *, boolean_t);
|
2017-05-19 12:33:11 -07:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_pool_checkpoint(const char *);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_pool_checkpoint_discard(const char *);
|
2016-12-16 14:11:29 -08:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_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 *);
|
2024-07-26 12:16:18 -04:00
|
|
|
|
|
|
|
|
_LIBZFS_CORE_H int lzc_pool_prefetch(const char *, zpool_prefetch_type_t);
|
|
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
|
2019-09-13 18:09:06 -07:00
|
|
|
|
2021-06-03 23:50:07 +02:00
|
|
|
_LIBZFS_CORE_H int lzc_set_bootenv(const char *, const nvlist_t *);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_get_bootenv(const char *, nvlist_t **);
|
2021-11-30 09:46:25 -05:00
|
|
|
|
|
|
|
|
_LIBZFS_CORE_H int lzc_get_vdev_prop(const char *, nvlist_t *, nvlist_t **);
|
|
|
|
|
_LIBZFS_CORE_H int lzc_set_vdev_prop(const char *, nvlist_t *, nvlist_t **);
|
|
|
|
|
|
2021-12-17 21:35:28 +01:00
|
|
|
_LIBZFS_CORE_H int lzc_scrub(zfs_ioc_t, const char *, nvlist_t *, nvlist_t **);
|
|
|
|
|
|
2024-06-17 22:35:18 +00:00
|
|
|
_LIBZFS_CORE_H int lzc_ddt_prune(const char *, zpool_ddt_prune_unit_t,
|
|
|
|
|
uint64_t);
|
|
|
|
|
|
2013-08-28 06:45:09 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* _LIBZFS_CORE_H */
|