FreeBSD ZFS
The Zettabyte File System

sys/txg_impl.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 2009 Sun Microsystems, Inc.  All rights reserved.
00023  * Use is subject to license terms.
00024  */
00025 
00026 #ifndef _SYS_TXG_IMPL_H
00027 #define _SYS_TXG_IMPL_H
00028 
00029 #include <sys/spa.h>
00030 #include <sys/txg.h>
00031 
00032 #ifdef  __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 struct tx_cpu {
00037         kmutex_t        tc_lock;
00038         kcondvar_t      tc_cv[TXG_SIZE];
00039         uint64_t        tc_count[TXG_SIZE];
00040         list_t          tc_callbacks[TXG_SIZE]; 
00041         char            tc_pad[16];
00042 };
00043 
00044 typedef struct tx_state {
00045         tx_cpu_t        *tx_cpu;        
00046         kmutex_t        tx_sync_lock;   
00047         uint64_t        tx_open_txg;    
00048         uint64_t        tx_quiesced_txg; 
00049         uint64_t        tx_syncing_txg; 
00050         uint64_t        tx_synced_txg;  
00052         uint64_t        tx_sync_txg_waiting; 
00053         uint64_t        tx_quiesce_txg_waiting; 
00055         kcondvar_t      tx_sync_more_cv;
00056         kcondvar_t      tx_sync_done_cv;
00057         kcondvar_t      tx_quiesce_more_cv;
00058         kcondvar_t      tx_quiesce_done_cv;
00059         kcondvar_t      tx_timeout_cv;
00060         kcondvar_t      tx_exit_cv;     
00062         uint8_t         tx_threads;     
00063         uint8_t         tx_exiting;     
00065         kthread_t       *tx_sync_thread;
00066         kthread_t       *tx_quiesce_thread;
00067 
00068         taskq_t         *tx_commit_cb_taskq; 
00069 } tx_state_t;
00070 
00071 #ifdef  __cplusplus
00072 }
00073 #endif
00074 
00075 #endif  /* _SYS_TXG_IMPL_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines