zil_impl.h revision d80c45e0f58fa434ba37259ea2e2b12e0380c19a
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * Common Development and Distribution License (the "License").
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrens#pragma ident "%Z%%M% %I% %E% SMI"
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef enum lwb_state_type {
fa9e4066f08beec538e775443c5be79dd423fcabahrens SEQ_INCOMPLETE, /* buffer written, but there's an unwritten buffer in */
fa9e4066f08beec538e775443c5be79dd423fcabahrens /* the sequence before this */
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Log write buffer.
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct lwb {
fa9e4066f08beec538e775443c5be79dd423fcabahrens blkptr_t lwb_blk; /* on disk address of this log blk */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t lwb_seq; /* highest log record seq number */
fa9e4066f08beec538e775443c5be79dd423fcabahrens txg_handle_t lwb_txgh; /* txg handle for txg_exit() */
fa9e4066f08beec538e775443c5be79dd423fcabahrens list_node_t lwb_node; /* zilog->zl_lwb_list linkage */
fa9e4066f08beec538e775443c5be79dd423fcabahrens * [vdev, seq] element for use in flushing device write caches
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct zil_vdev {
fa9e4066f08beec538e775443c5be79dd423fcabahrens list_node_t vdev_seq_node; /* zilog->zl_vdev_list linkage */
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Stable storage intent log management structure. One per dataset.
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick const zil_header_t *zl_header; /* log header buffer */
fa9e4066f08beec538e775443c5be79dd423fcabahrens zil_get_data_t *zl_get_data; /* callback to get object content */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t zl_destroy_txg; /* txg of last zil_destroy() */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t zl_replay_seq[TXG_SIZE]; /* seq of last replayed rec */
fa9e4066f08beec538e775443c5be79dd423fcabahrens kcondvar_t zl_cv_write; /* for waiting to write to log */
fa9e4066f08beec538e775443c5be79dd423fcabahrens kcondvar_t zl_cv_seq; /* for committing a sequence */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick kcondvar_t zl_cv_suspend; /* log suspend completion */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick uint8_t zl_suspending; /* log is currently suspending */
d80c45e0f58fa434ba37259ea2e2b12e0380c19abonwick uint8_t zl_keep_first; /* keep first log block in destroy */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint8_t zl_stop_replay; /* don't replay any further */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint8_t zl_writer; /* boolean: write setup in progress */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t zl_itx_list_sz; /* total size of records on list */
22ac5be40819d45ddf9d12dc1db410dbcdaac4abperrin uint64_t zl_cur_used; /* current commit log size used */
22ac5be40819d45ddf9d12dc1db410dbcdaac4abperrin uint64_t zl_prev_used; /* previous commit log size used */
fa9e4066f08beec538e775443c5be79dd423fcabahrens taskq_t *zl_clean_taskq; /* runs lwb and itx clean tasks */
fa9e4066f08beec538e775443c5be79dd423fcabahrens avl_tree_t zl_dva_tree; /* track DVAs during log parse */
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct zil_dva_node {
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_ZIL_IMPL_H */