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
55da60b91d96984f12de050ce428373ea25c7f35Mark J Musante * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
ce636f8b38e8c9ff484e880d9abb27251a882860Matthew Ahrens * Copyright (c) 2012 by Delphix. All rights reserved.
c3d26abc9ee97b4f60233556aadeb57e0bd30bb9Matthew Ahrens * Copyright (c) 2014 Integros [integros.com]
55da60b91d96984f12de050ce428373ea25c7f35Mark J Musante/* Portions Copyright 2010 Robert Milkowski */
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Log write buffer.
fa9e4066f08beec538e775443c5be79dd423fcabahrens blkptr_t lwb_blk; /* on disk address of this log blk */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick dmu_tx_t *lwb_tx; /* tx for log block allocation */
fa9e4066f08beec538e775443c5be79dd423fcabahrens list_node_t lwb_node; /* zilog->zl_lwb_list linkage */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin * Intent log transaction lists
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin list_t i_sync_list; /* list of synchronous itxs */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin avl_tree_t i_async_tree; /* tree of foids for async itxs */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin kmutex_t itxg_lock; /* lock for this structure */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin uint64_t itxg_sod; /* total size on disk for this txg */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin/* for async nodes we build up an AVL tree of lists of async itxs per file */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin list_t ia_list; /* list of async itxs for this foid */
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.
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 */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_lr_seq; /* on-disk log record sequence number */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_commit_lr_seq; /* last committed on-disk lr seq */
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 */
55da60b91d96984f12de050ce428373ea25c7f35Mark J Musante uint8_t zl_sync; /* synchronous or asynchronous */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick int zl_parse_error; /* last zil_parse() error */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_parse_blk_seq; /* highest blk seq on last parse */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_parse_lr_seq; /* highest lr seq on last parse */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_parse_blk_count; /* number of blocks parsed */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick uint64_t zl_parse_lr_count; /* number of log records parsed */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin uint64_t zl_com_batch; /* committed batch number */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin kcondvar_t zl_cv_batch[2]; /* batch condition variables */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin itxg_t zl_itxg[TXG_SIZE]; /* intent log txg chains */
5002558f6bfef3915c7f3b4ecb7c19c7f044bf5bNeil Perrin list_t zl_itx_commit_list; /* itx list to be committed */
fa9e4066f08beec538e775443c5be79dd423fcabahrens uint64_t zl_itx_list_sz; /* total size of records on list */
22ac5be40819d45ddf9d12dc1db410dbcdaac4abperrin uint64_t zl_cur_used; /* current 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 */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick avl_tree_t zl_bp_tree; /* track bps 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 */
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick zil_header_t zl_old_header; /* debugging aid */
6e1f5caa9321646aa4212d48e32a0d241866d85dNeil Perrin uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */
ce636f8b38e8c9ff484e880d9abb27251a882860Matthew Ahrens txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */
b515258426fed6c7311fd3f1dea697cfbd4085c6Matthew Ahrens#define ZIL_MAX_LOG_DATA (SPA_OLD_MAXBLOCKSIZE - sizeof (zil_chain_t) - \
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_ZIL_IMPL_H */