author | Matthew Ahrens <mahrens@delphix.com> |
Wed, 14 Aug 2013 11:42:31 -0800 | |
changeset 14220 | f7523d207d74 |
parent 14046 | 4972ab336f54 |
permissions | -rw-r--r-- |
13797
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
1 |
/* |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
2 |
* CDDL HEADER START |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
3 |
* |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
4 |
* The contents of this file are subject to the terms of the |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
7 |
* |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
9 |
* or http://www.opensolaris.org/os/licensing. |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
10 |
* See the License for the specific language governing permissions |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
11 |
* and limitations under the License. |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
12 |
* |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
18 |
* |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
19 |
* CDDL HEADER END |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
20 |
*/ |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
21 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
22 |
/* |
14220
f7523d207d74
3996 want a libzfs_core API to rollback to latest snapshot
Matthew Ahrens <mahrens@delphix.com>
parents:
14046
diff
changeset
|
23 |
* Copyright (c) 2013 by Delphix. All rights reserved. |
13797
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
24 |
*/ |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
25 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
26 |
#ifndef _LIBZFS_CORE_H |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
27 |
#define _LIBZFS_CORE_H |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
28 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
29 |
#include <libnvpair.h> |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
30 |
#include <sys/param.h> |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
31 |
#include <sys/types.h> |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
32 |
#include <sys/fs/zfs.h> |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
33 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
34 |
#ifdef __cplusplus |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
35 |
extern "C" { |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
36 |
#endif |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
37 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
38 |
int libzfs_core_init(void); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
39 |
void libzfs_core_fini(void); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
40 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
41 |
int lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
42 |
int lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
43 |
int lzc_clone(const char *fsname, const char *origin, nvlist_t *props); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
44 |
int lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
45 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
46 |
int lzc_snaprange_space(const char *firstsnap, const char *lastsnap, |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
47 |
uint64_t *usedp); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
48 |
|
14046
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13797
diff
changeset
|
49 |
int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13797
diff
changeset
|
50 |
int lzc_release(nvlist_t *holds, nvlist_t **errlist); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13797
diff
changeset
|
51 |
int lzc_get_holds(const char *snapname, nvlist_t **holdsp); |
4972ab336f54
3464 zfs synctask code needs restructuring
Matthew Ahrens <mahrens@delphix.com>
parents:
13797
diff
changeset
|
52 |
|
13797
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
53 |
int lzc_send(const char *snapname, const char *fromsnap, int fd); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
54 |
int lzc_receive(const char *snapname, nvlist_t *props, const char *origin, |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
55 |
boolean_t force, int fd); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
56 |
int lzc_send_space(const char *snapname, const char *fromsnap, |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
57 |
uint64_t *result); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
58 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
59 |
boolean_t lzc_exists(const char *dataset); |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
60 |
|
14220
f7523d207d74
3996 want a libzfs_core API to rollback to latest snapshot
Matthew Ahrens <mahrens@delphix.com>
parents:
14046
diff
changeset
|
61 |
int lzc_rollback(const char *fsname, char *snapnamebuf, int snapnamelen); |
13797
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
62 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
63 |
#ifdef __cplusplus |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
64 |
} |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
65 |
#endif |
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
66 |
|
95aba6e49b9f
2882 implement libzfs_core
Matthew Ahrens <mahrens@delphix.com>
parents:
diff
changeset
|
67 |
#endif /* _LIBZFS_CORE_H */ |