4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens/*
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * CDDL HEADER START
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens *
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * The contents of this file are subject to the terms of the
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * Common Development and Distribution License (the "License").
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * You may not use this file except in compliance with the License.
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens *
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * or http://www.opensolaris.org/os/licensing.
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * See the License for the specific language governing permissions
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * and limitations under the License.
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens *
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * When distributing Covered Code, include this CDDL HEADER in each
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * If applicable, add the following below this CDDL HEADER, with the
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * fields enclosed by brackets "[]" replaced with your own identifying
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * information: Portions Copyright [yyyy] [name of copyright owner]
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens *
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens * CDDL HEADER END
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens */
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens/*
9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8Matthew Ahrens * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
c3d26abc9ee97b4f60233556aadeb57e0bd30bb9Matthew Ahrens * Copyright (c) 2014 Integros [integros.com]
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens */
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#ifndef _LIBZFS_CORE_H
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#define _LIBZFS_CORE_H
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#include <libnvpair.h>
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#include <sys/param.h>
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#include <sys/types.h>
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#ifdef __cplusplus
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrensextern "C" {
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#endif
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrensint libzfs_core_init(void);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrensvoid libzfs_core_fini(void);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon/*
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon * NB: this type should be kept binary compatible with dmu_objset_type_t.
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon */
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gaponenum lzc_dataset_type {
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon LZC_DATSET_TYPE_ZFS = 2,
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon LZC_DATSET_TYPE_ZVOL
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon};
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gapon
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_snapshot(nvlist_t *, nvlist_t *, nvlist_t **);
26455f9efcf9b1e44937d4d86d1ce37b006f25a9Andriy Gaponint lzc_create(const char *, enum lzc_dataset_type, nvlist_t *);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_clone(const char *, const char *, nvlist_t *);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_destroy_snaps(nvlist_t *, boolean_t, nvlist_t **);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_bookmark(nvlist_t *, nvlist_t **);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_get_bookmarks(const char *, nvlist_t *, nvlist_t **);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_destroy_bookmarks(nvlist_t *, nvlist_t **);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_snaprange_space(const char *, const char *, uint64_t *);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_hold(nvlist_t *, int, nvlist_t **);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_release(nvlist_t *, nvlist_t **);
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_get_holds(const char *, nvlist_t **);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrens
5d7b4d438c4a51eccc95e77a83a437b4d48380ebMatthew Ahrensenum lzc_send_flags {
b515258426fed6c7311fd3f1dea697cfbd4085c6Matthew Ahrens LZC_SEND_FLAG_EMBED_DATA = 1 << 0,
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1,
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmel LZC_SEND_FLAG_COMPRESS = 1 << 2
5d7b4d438c4a51eccc95e77a83a437b4d48380ebMatthew Ahrens};
5d7b4d438c4a51eccc95e77a83a437b4d48380ebMatthew Ahrens
5d7b4d438c4a51eccc95e77a83a437b4d48380ebMatthew Ahrensint lzc_send(const char *, const char *, int, enum lzc_send_flags);
9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8Matthew Ahrensint lzc_send_resume(const char *, const char *, int,
9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8Matthew Ahrens enum lzc_send_flags, uint64_t, uint64_t);
5602294fda888d923d57a78bafdaf48ae6223deaDan Kimmelint lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *);
620f322510b2d6433f7f6af60fa52380c07756adAndriy Gapon
620f322510b2d6433f7f6af60fa52380c07756adAndriy Gaponstruct dmu_replay_record;
620f322510b2d6433f7f6af60fa52380c07756adAndriy Gapon
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int);
9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8Matthew Ahrensint lzc_receive_resumable(const char *, nvlist_t *, const char *,
9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8Matthew Ahrens boolean_t, int);
620f322510b2d6433f7f6af60fa52380c07756adAndriy Gaponint lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t,
620f322510b2d6433f7f6af60fa52380c07756adAndriy Gapon boolean_t, int, const struct dmu_replay_record *);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensboolean_t lzc_exists(const char *);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
78f171005391b928aaf1642b3206c534ed644332Matthew Ahrensint lzc_rollback(const char *, char *, int);
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#ifdef __cplusplus
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens}
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#endif
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens
4445fffbbb1ea25fd0e9ea68b9380dd7a6709025Matthew Ahrens#endif /* _LIBZFS_CORE_H */