xref: /freebsd/sys/contrib/openzfs/include/sys/dsl_destroy.h (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1 // SPDX-License-Identifier: CDDL-1.0
2 /*
3  * CDDL HEADER START
4  *
5  * The contents of this file are subject to the terms of the
6  * Common Development and Distribution License (the "License").
7  * You may not use this file except in compliance with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or https://opensource.org/licenses/CDDL-1.0.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
25  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
26  */
27 
28 #ifndef	_SYS_DSL_DESTROY_H
29 #define	_SYS_DSL_DESTROY_H
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 struct nvlist;
36 struct dsl_dataset;
37 struct dsl_pool;
38 struct dmu_tx;
39 
40 int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t,
41     struct nvlist *);
42 int dsl_destroy_snapshot(const char *, boolean_t);
43 int dsl_destroy_head(const char *);
44 int dsl_destroy_head_check_impl(struct dsl_dataset *, int);
45 void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *);
46 int dsl_destroy_inconsistent(const char *, void *);
47 int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t);
48 void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *,
49     boolean_t, struct dmu_tx *);
50 void dsl_dir_remove_clones_key(dsl_dir_t *, uint64_t, dmu_tx_t *);
51 
52 typedef struct dsl_destroy_snapshot_arg {
53 	const char *ddsa_name;
54 	boolean_t ddsa_defer;
55 } dsl_destroy_snapshot_arg_t;
56 
57 int dsl_destroy_snapshot_check(void *, dmu_tx_t *);
58 void dsl_destroy_snapshot_sync(void *, dmu_tx_t *);
59 
60 typedef struct dsl_destroy_head_arg {
61 	const char *ddha_name;
62 } dsl_destroy_head_arg_t;
63 
64 int dsl_destroy_head_check(void *, dmu_tx_t *);
65 void dsl_destroy_head_sync(void *, dmu_tx_t *);
66 
67 #ifdef	__cplusplus
68 }
69 #endif
70 
71 #endif /* _SYS_DSL_DESTROY_H */
72