xref: /freebsd/sys/contrib/openzfs/include/sys/dsl_userhold.h (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1 // SPDX-License-Identifier: CDDL-1.0
2 
3 /*
4  * CDDL HEADER START
5  *
6  * The contents of this file are subject to the terms of the
7  * Common Development and Distribution License (the "License").
8  * You may not use this file except in compliance with the License.
9  *
10  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11  * or https://opensource.org/licenses/CDDL-1.0.
12  * See the License for the specific language governing permissions
13  * and limitations under the License.
14  *
15  * When distributing Covered Code, include this CDDL HEADER in each
16  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17  * If applicable, add the following below this CDDL HEADER, with the
18  * fields enclosed by brackets "[]" replaced with your own identifying
19  * information: Portions Copyright [yyyy] [name of copyright owner]
20  *
21  * CDDL HEADER END
22  */
23 /*
24  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
25  * Copyright (c) 2012 by Delphix. All rights reserved.
26  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27  * Copyright (c) 2013 Steven Hartland. All rights reserved.
28  */
29 
30 #ifndef	_SYS_DSL_USERHOLD_H
31 #define	_SYS_DSL_USERHOLD_H
32 
33 #include <sys/nvpair.h>
34 #include <sys/types.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 struct dsl_pool;
41 struct dsl_dataset;
42 struct dmu_tx;
43 
44 int dsl_dataset_user_hold(nvlist_t *holds, minor_t cleanup_minor,
45     nvlist_t *errlist);
46 int dsl_dataset_user_release(nvlist_t *holds, nvlist_t *errlist);
47 int dsl_dataset_get_holds(const char *dsname, nvlist_t *nvl);
48 void dsl_dataset_user_release_tmp(struct dsl_pool *dp, nvlist_t *holds);
49 int dsl_dataset_user_hold_check_one(struct dsl_dataset *ds, const char *htag,
50     boolean_t temphold, struct dmu_tx *tx);
51 void dsl_dataset_user_hold_sync_one(struct dsl_dataset *ds, const char *htag,
52     minor_t minor, uint64_t now, struct dmu_tx *tx);
53 
54 #ifdef	__cplusplus
55 }
56 #endif
57 
58 #endif /* _SYS_DSL_USERHOLD_H */
59