4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _SYS_DSL_SYNCTASK_H
26 #define _SYS_DSL_SYNCTASK_H
29 #include <sys/zfs_context.h>
37 typedef int (dsl_checkfunc_t)(void *, void *, dmu_tx_t *);
38 typedef void (dsl_syncfunc_t)(void *, void *, dmu_tx_t *);
40 typedef struct dsl_sync_task {
42 dsl_checkfunc_t *dst_checkfunc;
43 dsl_syncfunc_t *dst_syncfunc;
49 typedef struct dsl_sync_task_group {
52 struct dsl_pool *dstg_pool;
56 boolean_t dstg_nowaiter;
57 } dsl_sync_task_group_t;
59 dsl_sync_task_group_t *dsl_sync_task_group_create(struct dsl_pool *dp);
60 void dsl_sync_task_create(dsl_sync_task_group_t *dstg,
61 dsl_checkfunc_t *, dsl_syncfunc_t *,
62 void *arg1, void *arg2, int blocks_modified);
63 int dsl_sync_task_group_wait(dsl_sync_task_group_t *dstg);
64 void dsl_sync_task_group_nowait(dsl_sync_task_group_t *dstg, dmu_tx_t *tx);
65 void dsl_sync_task_group_destroy(dsl_sync_task_group_t *dstg);
66 void dsl_sync_task_group_sync(dsl_sync_task_group_t *dstg, dmu_tx_t *tx);
68 int dsl_sync_task_do(struct dsl_pool *dp,
69 dsl_checkfunc_t *checkfunc, dsl_syncfunc_t *syncfunc,
70 void *arg1, void *arg2, int blocks_modified);
71 void dsl_sync_task_do_nowait(struct dsl_pool *dp,
72 dsl_checkfunc_t *checkfunc, dsl_syncfunc_t *syncfunc,
73 void *arg1, void *arg2, int blocks_modified, dmu_tx_t *tx);
79 #endif /* _SYS_DSL_SYNCTASK_H */