zil_impl.h revision e09fa4dacfb671e707d50a55ae9b5cc191e1b8cb
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
510b6c0e09388dd3bd75e2d1afd0f1ef80a7f440Neil Perrin * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Log write buffer.
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct lwb {
fa9e4066f08beec538e775443c5be79dd423fcabahrens blkptr_t lwb_blk; /* on disk address of this log blk */
fa9e4066f08beec538e775443c5be79dd423fcabahrens txg_handle_t lwb_txgh; /* txg handle for txg_exit() */
fa9e4066f08beec538e775443c5be79dd423fcabahrens list_node_t lwb_node; /* zilog->zl_lwb_list linkage */
17f17c2df4ca603e787c5fc03b7af83519edfd2cbonwick * Vdev flushing: during a zil_commit(), we build up an AVL tree of the vdevs
17f17c2df4ca603e787c5fc03b7af83519edfd2cbonwick * we've touched so we know which ones need a write cache flush at the end.
17f17c2df4ca603e787c5fc03b7af83519edfd2cbonwicktypedef struct zil_vdev_node {
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 */
67bd71c6cc629bab3aa0d595c624a667f1574254perrin uint64_t zl_commit_seq; /* committed upto this number */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t zl_destroy_txg; /* txg of last zil_destroy() */
1209a471b5681c43d839d4b890f708f500da7346Neil Perrin uint64_t zl_replayed_seq[TXG_SIZE]; /* last replayed rec seq */
1209a471b5681c43d839d4b890f708f500da7346Neil Perrin uint64_t zl_replaying_seq; /* current replay seq number */
b19a79ec1a527828a60c4d325ccd8dcbeb2b2e8bperrin kcondvar_t zl_cv_writer; /* log writer thread completion */
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 */
1209a471b5681c43d839d4b890f708f500da7346Neil Perrin uint8_t zl_replay; /* replaying records while set */
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 */
17f17c2df4ca603e787c5fc03b7af83519edfd2cbonwick avl_tree_t zl_vdev_tree; /* vdevs to flush in zil_commit() */
fa9e4066f08beec538e775443c5be79dd423fcabahrens taskq_t *zl_clean_taskq; /* runs lwb and itx clean tasks */
fa9e4066f08beec538e775443c5be79dd423fcabahrens avl_tree_t zl_dva_tree; /* track DVAs during log parse */
67bd71c6cc629bab3aa0d595c624a667f1574254perrin clock_t zl_replay_time; /* lbolt of when replay started */
67bd71c6cc629bab3aa0d595c624a667f1574254perrin uint64_t zl_replay_blks; /* number of log blocks replayed */
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct zil_dva_node {
510b6c0e09388dd3bd75e2d1afd0f1ef80a7f440Neil Perrin#define ZIL_MAX_LOG_DATA (SPA_MAXBLOCKSIZE - sizeof (zil_trailer_t) - \
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_ZIL_IMPL_H */