3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_SPA_IMPL_H
28 #define _SYS_SPA_IMPL_H
29
30 #include <sys/spa.h>
31 #include <sys/vdev.h>
32 #include <sys/metaslab.h>
33 #include <sys/dmu.h>
34 #include <sys/dsl_pool.h>
35 #include <sys/uberblock_impl.h>
36 #include <sys/zfs_context.h>
37 #include <sys/avl.h>
38 #include <sys/refcount.h>
39 #include <sys/bplist.h>
40 #include <sys/bpobj.h>
41
42 #ifdef __cplusplus
43 extern "C" {
217 ddt_t *spa_ddt[ZIO_CHECKSUM_FUNCTIONS]; /* in-core DDTs */
218 uint64_t spa_ddt_stat_object; /* DDT statistics */
219 uint64_t spa_dedup_ditto; /* dedup ditto threshold */
220 uint64_t spa_dedup_checksum; /* default dedup checksum */
221 uint64_t spa_dspace; /* dspace in normal class */
222 kmutex_t spa_vdev_top_lock; /* dueling offline/remove */
223 kmutex_t spa_proc_lock; /* protects spa_proc* */
224 kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
225 spa_proc_state_t spa_proc_state; /* see definition */
226 struct proc *spa_proc; /* "zpool-poolname" process */
227 uint64_t spa_did; /* if procp != p0, did of t1 */
228 boolean_t spa_autoreplace; /* autoreplace set in open */
229 int spa_vdev_locks; /* locks grabbed */
230 uint64_t spa_creation_version; /* version at pool creation */
231 uint64_t spa_prev_software_version; /* See ub_software_version */
232 uint64_t spa_feat_for_write_obj; /* required to write to pool */
233 uint64_t spa_feat_for_read_obj; /* required to read from pool */
234 uint64_t spa_feat_desc_obj; /* Feature descriptions */
235 cyclic_id_t spa_deadman_cycid; /* cyclic id */
236 uint64_t spa_deadman_calls; /* number of deadman calls */
237 uint64_t spa_sync_starttime; /* starting time fo spa_sync */
238 uint64_t spa_deadman_synctime; /* deadman expiration timer */
239 kmutex_t spa_iokstat_lock; /* protects spa_iokstat_* */
240 struct kstat *spa_iokstat; /* kstat of io to this pool */
241 hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */
242 /*
243 * spa_refcount & spa_config_lock must be the last elements
244 * because refcount_t changes size based on compilation options.
245 * In order for the MDB module to function correctly, the other
246 * fields must remain in the same location.
247 */
248 spa_config_lock_t spa_config_lock[SCL_LOCKS]; /* config changes */
249 refcount_t spa_refcount; /* number of opens */
250 };
251
252 extern const char *spa_config_path;
253
254 extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
255 task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
256
257 #ifdef __cplusplus
258 }
259 #endif
260
261 #endif /* _SYS_SPA_IMPL_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_SPA_IMPL_H
28 #define _SYS_SPA_IMPL_H
29
30 #include <sys/spa.h>
31 #include <sys/vdev.h>
32 #include <sys/metaslab.h>
33 #include <sys/dmu.h>
34 #include <sys/dsl_pool.h>
35 #include <sys/uberblock_impl.h>
36 #include <sys/zfs_context.h>
37 #include <sys/avl.h>
38 #include <sys/refcount.h>
39 #include <sys/bplist.h>
40 #include <sys/bpobj.h>
41
42 #ifdef __cplusplus
43 extern "C" {
217 ddt_t *spa_ddt[ZIO_CHECKSUM_FUNCTIONS]; /* in-core DDTs */
218 uint64_t spa_ddt_stat_object; /* DDT statistics */
219 uint64_t spa_dedup_ditto; /* dedup ditto threshold */
220 uint64_t spa_dedup_checksum; /* default dedup checksum */
221 uint64_t spa_dspace; /* dspace in normal class */
222 kmutex_t spa_vdev_top_lock; /* dueling offline/remove */
223 kmutex_t spa_proc_lock; /* protects spa_proc* */
224 kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
225 spa_proc_state_t spa_proc_state; /* see definition */
226 struct proc *spa_proc; /* "zpool-poolname" process */
227 uint64_t spa_did; /* if procp != p0, did of t1 */
228 boolean_t spa_autoreplace; /* autoreplace set in open */
229 int spa_vdev_locks; /* locks grabbed */
230 uint64_t spa_creation_version; /* version at pool creation */
231 uint64_t spa_prev_software_version; /* See ub_software_version */
232 uint64_t spa_feat_for_write_obj; /* required to write to pool */
233 uint64_t spa_feat_for_read_obj; /* required to read from pool */
234 uint64_t spa_feat_desc_obj; /* Feature descriptions */
235 cyclic_id_t spa_deadman_cycid; /* cyclic id */
236 uint64_t spa_deadman_calls; /* number of deadman calls */
237 hrtime_t spa_sync_starttime; /* starting time fo spa_sync */
238 uint64_t spa_deadman_synctime; /* deadman expiration timer */
239
240 /*
241 * spa_iokstat_lock protects spa_iokstat and
242 * spa_queue_stats[].
243 */
244 kmutex_t spa_iokstat_lock;
245 struct kstat *spa_iokstat; /* kstat of io to this pool */
246 struct {
247 int spa_active;
248 int spa_queued;
249 } spa_queue_stats[ZIO_PRIORITY_NUM_QUEUEABLE];
250
251 hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */
252
253 /*
254 * spa_refcount & spa_config_lock must be the last elements
255 * because refcount_t changes size based on compilation options.
256 * In order for the MDB module to function correctly, the other
257 * fields must remain in the same location.
258 */
259 spa_config_lock_t spa_config_lock[SCL_LOCKS]; /* config changes */
260 refcount_t spa_refcount; /* number of opens */
261 };
262
263 extern const char *spa_config_path;
264
265 extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
266 task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
267
268 #ifdef __cplusplus
269 }
270 #endif
271
272 #endif /* _SYS_SPA_IMPL_H */
|