FreeBSD ZFS
The Zettabyte File System

sys/dsl_synctask.h

Go to the documentation of this file.
00001 /*
00002  * CDDL HEADER START
00003  *
00004  * The contents of this file are subject to the terms of the
00005  * Common Development and Distribution License (the "License").
00006  * You may not use this file except in compliance with the License.
00007  *
00008  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
00009  * or http://www.opensolaris.org/os/licensing.
00010  * See the License for the specific language governing permissions
00011  * and limitations under the License.
00012  *
00013  * When distributing Covered Code, include this CDDL HEADER in each
00014  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
00015  * If applicable, add the following below this CDDL HEADER, with the
00016  * fields enclosed by brackets "[]" replaced with your own identifying
00017  * information: Portions Copyright [yyyy] [name of copyright owner]
00018  *
00019  * CDDL HEADER END
00020  */
00021 /*
00022  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
00023  */
00024 
00025 #ifndef _SYS_DSL_SYNCTASK_H
00026 #define _SYS_DSL_SYNCTASK_H
00027 
00028 #include <sys/txg.h>
00029 #include <sys/zfs_context.h>
00030 
00031 #ifdef  __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 struct dsl_pool;
00036 
00037 typedef int (dsl_checkfunc_t)(void *, void *, dmu_tx_t *);
00038 typedef void (dsl_syncfunc_t)(void *, void *, dmu_tx_t *);
00039 
00040 typedef struct dsl_sync_task {
00041         list_node_t dst_node;
00042         dsl_checkfunc_t *dst_checkfunc;
00043         dsl_syncfunc_t *dst_syncfunc;
00044         void *dst_arg1;
00045         void *dst_arg2;
00046         int dst_err;
00047 } dsl_sync_task_t;
00048 
00049 typedef struct dsl_sync_task_group {
00050         txg_node_t dstg_node;
00051         list_t dstg_tasks;
00052         struct dsl_pool *dstg_pool;
00053         uint64_t dstg_txg;
00054         int dstg_err;
00055         int dstg_space;
00056         boolean_t dstg_nowaiter;
00057 } dsl_sync_task_group_t;
00058 
00059 dsl_sync_task_group_t *dsl_sync_task_group_create(struct dsl_pool *dp);
00060 void dsl_sync_task_create(dsl_sync_task_group_t *dstg,
00061     dsl_checkfunc_t *, dsl_syncfunc_t *,
00062     void *arg1, void *arg2, int blocks_modified);
00063 int dsl_sync_task_group_wait(dsl_sync_task_group_t *dstg);
00064 void dsl_sync_task_group_nowait(dsl_sync_task_group_t *dstg, dmu_tx_t *tx);
00065 void dsl_sync_task_group_destroy(dsl_sync_task_group_t *dstg);
00066 void dsl_sync_task_group_sync(dsl_sync_task_group_t *dstg, dmu_tx_t *tx);
00067 
00068 int dsl_sync_task_do(struct dsl_pool *dp,
00069     dsl_checkfunc_t *checkfunc, dsl_syncfunc_t *syncfunc,
00070     void *arg1, void *arg2, int blocks_modified);
00071 void dsl_sync_task_do_nowait(struct dsl_pool *dp,
00072     dsl_checkfunc_t *checkfunc, dsl_syncfunc_t *syncfunc,
00073     void *arg1, void *arg2, int blocks_modified, dmu_tx_t *tx);
00074 
00075 #ifdef  __cplusplus
00076 }
00077 #endif
00078 
00079 #endif /* _SYS_DSL_SYNCTASK_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines