]> git.proxmox.com Git - mirror_zfs.git/blame - include/sys/vdev_impl.h
OpenZFS 9166 - zfs storage pool checkpoint
[mirror_zfs.git] / include / sys / vdev_impl.h
CommitLineData
34dc7c2f
BB
1/*
2 * CDDL HEADER START
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/*
428870ff 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
d2734cce 23 * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
34dc7c2f
BB
24 */
25
26#ifndef _SYS_VDEV_IMPL_H
27#define _SYS_VDEV_IMPL_H
28
34dc7c2f 29#include <sys/avl.h>
a1d477c2 30#include <sys/bpobj.h>
34dc7c2f
BB
31#include <sys/dmu.h>
32#include <sys/metaslab.h>
33#include <sys/nvpair.h>
34#include <sys/space_map.h>
35#include <sys/vdev.h>
36#include <sys/dkio.h>
37#include <sys/uberblock_impl.h>
a1d477c2
MA
38#include <sys/vdev_indirect_mapping.h>
39#include <sys/vdev_indirect_births.h>
40#include <sys/vdev_removal.h>
6078881a 41#include <sys/zfs_ratelimit.h>
34dc7c2f
BB
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/*
48 * Virtual device descriptors.
49 *
50 * All storage pool operations go through the virtual device framework,
51 * which provides data replication and I/O scheduling.
52 */
53
54/*
55 * Forward declarations that lots of things need.
56 */
57typedef struct vdev_queue vdev_queue_t;
58typedef struct vdev_cache vdev_cache_t;
59typedef struct vdev_cache_entry vdev_cache_entry_t;
a6255b7f 60struct abd;
34dc7c2f 61
3dfb57a3
DB
62extern int zfs_vdev_queue_depth_pct;
63extern uint32_t zfs_vdev_async_write_max_active;
64
34dc7c2f
BB
65/*
66 * Virtual device operations
67 */
1bd201e7
CS
68typedef int vdev_open_func_t(vdev_t *vd, uint64_t *size, uint64_t *max_size,
69 uint64_t *ashift);
34dc7c2f 70typedef void vdev_close_func_t(vdev_t *vd);
34dc7c2f 71typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize);
98b25418 72typedef void vdev_io_start_func_t(zio_t *zio);
b128c09f 73typedef void vdev_io_done_func_t(zio_t *zio);
34dc7c2f 74typedef void vdev_state_change_func_t(vdev_t *vd, int, int);
3d6da72d 75typedef boolean_t vdev_need_resilver_func_t(vdev_t *vd, uint64_t, size_t);
428870ff
BB
76typedef void vdev_hold_func_t(vdev_t *vd);
77typedef void vdev_rele_func_t(vdev_t *vd);
34dc7c2f 78
a1d477c2
MA
79typedef void vdev_remap_cb_t(uint64_t inner_offset, vdev_t *vd,
80 uint64_t offset, uint64_t size, void *arg);
81typedef void vdev_remap_func_t(vdev_t *vd, uint64_t offset, uint64_t size,
82 vdev_remap_cb_t callback, void *arg);
83
b01615d5 84typedef const struct vdev_ops {
34dc7c2f
BB
85 vdev_open_func_t *vdev_op_open;
86 vdev_close_func_t *vdev_op_close;
34dc7c2f
BB
87 vdev_asize_func_t *vdev_op_asize;
88 vdev_io_start_func_t *vdev_op_io_start;
89 vdev_io_done_func_t *vdev_op_io_done;
90 vdev_state_change_func_t *vdev_op_state_change;
3d6da72d 91 vdev_need_resilver_func_t *vdev_op_need_resilver;
428870ff
BB
92 vdev_hold_func_t *vdev_op_hold;
93 vdev_rele_func_t *vdev_op_rele;
a1d477c2 94 vdev_remap_func_t *vdev_op_remap;
34dc7c2f
BB
95 char vdev_op_type[16];
96 boolean_t vdev_op_leaf;
97} vdev_ops_t;
98
99/*
100 * Virtual device properties
101 */
102struct vdev_cache_entry {
a6255b7f 103 struct abd *ve_abd;
34dc7c2f 104 uint64_t ve_offset;
0b75bdb3 105 clock_t ve_lastused;
34dc7c2f
BB
106 avl_node_t ve_offset_node;
107 avl_node_t ve_lastused_node;
108 uint32_t ve_hits;
109 uint16_t ve_missed_update;
110 zio_t *ve_fill_io;
111};
112
113struct vdev_cache {
114 avl_tree_t vc_offset_tree;
115 avl_tree_t vc_lastused_tree;
116 kmutex_t vc_lock;
117};
118
e8b96c60
MA
119typedef struct vdev_queue_class {
120 uint32_t vqc_active;
121
122 /*
123 * Sorted by offset or timestamp, depending on if the queue is
124 * LBA-ordered vs FIFO.
125 */
126 avl_tree_t vqc_queued_tree;
127} vdev_queue_class_t;
128
34dc7c2f 129struct vdev_queue {
e8b96c60
MA
130 vdev_t *vq_vdev;
131 vdev_queue_class_t vq_class[ZIO_PRIORITY_NUM_QUEUEABLE];
132 avl_tree_t vq_active_tree;
ec8501ee
JG
133 avl_tree_t vq_read_offset_tree;
134 avl_tree_t vq_write_offset_tree;
e8b96c60
MA
135 uint64_t vq_last_offset;
136 hrtime_t vq_io_complete_ts; /* time last i/o completed */
cb682a17 137 hrtime_t vq_io_delta_ts;
50b25b21 138 zio_t vq_io_search; /* used as local for stack reduction */
34dc7c2f
BB
139 kmutex_t vq_lock;
140};
141
a1d477c2
MA
142/*
143 * On-disk indirect vdev state.
144 *
145 * An indirect vdev is described exclusively in the MOS config of a pool.
146 * The config for an indirect vdev includes several fields, which are
147 * accessed in memory by a vdev_indirect_config_t.
148 */
149typedef struct vdev_indirect_config {
150 /*
151 * Object (in MOS) which contains the indirect mapping. This object
152 * contains an array of vdev_indirect_mapping_entry_phys_t ordered by
153 * vimep_src. The bonus buffer for this object is a
154 * vdev_indirect_mapping_phys_t. This object is allocated when a vdev
155 * removal is initiated.
156 *
157 * Note that this object can be empty if none of the data on the vdev
158 * has been copied yet.
159 */
160 uint64_t vic_mapping_object;
161
162 /*
163 * Object (in MOS) which contains the birth times for the mapping
164 * entries. This object contains an array of
165 * vdev_indirect_birth_entry_phys_t sorted by vibe_offset. The bonus
166 * buffer for this object is a vdev_indirect_birth_phys_t. This object
167 * is allocated when a vdev removal is initiated.
168 *
169 * Note that this object can be empty if none of the vdev has yet been
170 * copied.
171 */
172 uint64_t vic_births_object;
173
174 /*
175 * This is the vdev ID which was removed previous to this vdev, or
176 * UINT64_MAX if there are no previously removed vdevs.
177 */
178 uint64_t vic_prev_indirect_vdev;
179} vdev_indirect_config_t;
180
34dc7c2f
BB
181/*
182 * Virtual device descriptor
183 */
184struct vdev {
185 /*
186 * Common to all vdev types.
187 */
188 uint64_t vdev_id; /* child number in vdev parent */
189 uint64_t vdev_guid; /* unique ID for this vdev */
190 uint64_t vdev_guid_sum; /* self guid + all child guids */
428870ff 191 uint64_t vdev_orig_guid; /* orig. guid prior to remove */
34dc7c2f 192 uint64_t vdev_asize; /* allocatable device capacity */
9babb374 193 uint64_t vdev_min_asize; /* min acceptable asize */
1bd201e7 194 uint64_t vdev_max_asize; /* max acceptable asize */
34dc7c2f
BB
195 uint64_t vdev_ashift; /* block alignment shift */
196 uint64_t vdev_state; /* see VDEV_STATE_* #defines */
197 uint64_t vdev_prevstate; /* used when reopening a vdev */
198 vdev_ops_t *vdev_ops; /* vdev operations */
199 spa_t *vdev_spa; /* spa for this vdev */
200 void *vdev_tsd; /* type-specific data */
428870ff
BB
201 vnode_t *vdev_name_vp; /* vnode for pathname */
202 vnode_t *vdev_devid_vp; /* vnode for devid */
34dc7c2f
BB
203 vdev_t *vdev_top; /* top-level vdev */
204 vdev_t *vdev_parent; /* parent vdev */
205 vdev_t **vdev_child; /* array of children */
206 uint64_t vdev_children; /* number of children */
34dc7c2f 207 vdev_stat_t vdev_stat; /* virtual device statistics */
193a37cb 208 vdev_stat_ex_t vdev_stat_ex; /* extended statistics */
9babb374 209 boolean_t vdev_expanding; /* expand the vdev? */
428870ff 210 boolean_t vdev_reopening; /* reopen in progress? */
fb40095f 211 boolean_t vdev_nonrot; /* true if solid state */
45d1cae3
BB
212 int vdev_open_error; /* error on last open */
213 kthread_t *vdev_open_thread; /* thread opening children */
428870ff 214 uint64_t vdev_crtxg; /* txg when top-level was added */
34dc7c2f
BB
215
216 /*
217 * Top-level vdev state.
218 */
219 uint64_t vdev_ms_array; /* metaslab array object */
220 uint64_t vdev_ms_shift; /* metaslab size shift */
221 uint64_t vdev_ms_count; /* number of metaslabs */
222 metaslab_group_t *vdev_mg; /* metaslab group */
223 metaslab_t **vdev_ms; /* metaslab array */
920dd524 224 uint64_t vdev_pending_fastwrite; /* allocated fastwrites */
34dc7c2f
BB
225 txg_list_t vdev_ms_list; /* per-txg dirty metaslab lists */
226 txg_list_t vdev_dtl_list; /* per-txg dirty DTL lists */
227 txg_node_t vdev_txg_node; /* per-txg dirty vdev linkage */
228 boolean_t vdev_remove_wanted; /* async remove wanted? */
b128c09f
BB
229 boolean_t vdev_probe_wanted; /* async probe wanted? */
230 list_node_t vdev_config_dirty_node; /* config dirty list */
231 list_node_t vdev_state_dirty_node; /* state dirty list */
34dc7c2f
BB
232 uint64_t vdev_deflate_ratio; /* deflation ratio (x512) */
233 uint64_t vdev_islog; /* is an intent log device */
93cf2076 234 uint64_t vdev_removing; /* device is being removed? */
3dfb57a3
DB
235 boolean_t vdev_ishole; /* is a hole in the namespace */
236 kmutex_t vdev_queue_lock; /* protects vdev_queue_depth */
e0ab3ab5 237 uint64_t vdev_top_zap;
34dc7c2f 238
d2734cce
SD
239 /* pool checkpoint related */
240 space_map_t *vdev_checkpoint_sm; /* contains reserved blocks */
241
a1d477c2
MA
242 /*
243 * Values stored in the config for an indirect or removing vdev.
244 */
245 vdev_indirect_config_t vdev_indirect_config;
246
247 /*
248 * The vdev_indirect_rwlock protects the vdev_indirect_mapping
249 * pointer from changing on indirect vdevs (when it is condensed).
250 * Note that removing (not yet indirect) vdevs have different
251 * access patterns (the mapping is not accessed from open context,
252 * e.g. from zio_read) and locking strategy (e.g. svr_lock).
253 */
254 krwlock_t vdev_indirect_rwlock;
255 vdev_indirect_mapping_t *vdev_indirect_mapping;
256 vdev_indirect_births_t *vdev_indirect_births;
257
258 /*
259 * In memory data structures used to manage the obsolete sm, for
260 * indirect or removing vdevs.
261 *
262 * The vdev_obsolete_segments is the in-core record of the segments
263 * that are no longer referenced anywhere in the pool (due to
264 * being freed or remapped and not referenced by any snapshots).
265 * During a sync, segments are added to vdev_obsolete_segments
266 * via vdev_indirect_mark_obsolete(); at the end of each sync
267 * pass, this is appended to vdev_obsolete_sm via
268 * vdev_indirect_sync_obsolete(). The vdev_obsolete_lock
269 * protects against concurrent modifications of vdev_obsolete_segments
270 * from multiple zio threads.
271 */
272 kmutex_t vdev_obsolete_lock;
273 range_tree_t *vdev_obsolete_segments;
274 space_map_t *vdev_obsolete_sm;
275
3dfb57a3
DB
276 /*
277 * The queue depth parameters determine how many async writes are
278 * still pending (i.e. allocated by net yet issued to disk) per
279 * top-level (vdev_async_write_queue_depth) and the maximum allowed
280 * (vdev_max_async_write_queue_depth). These values only apply to
281 * top-level vdevs.
282 */
283 uint64_t vdev_async_write_queue_depth;
284 uint64_t vdev_max_async_write_queue_depth;
285
d4a72f23
TC
286 /*
287 * Protects the vdev_scan_io_queue field itself as well as the
288 * structure's contents (when present).
289 */
290 kmutex_t vdev_scan_io_queue_lock;
291 struct dsl_scan_io_queue *vdev_scan_io_queue;
292
34dc7c2f
BB
293 /*
294 * Leaf vdev state.
295 */
93cf2076
GW
296 range_tree_t *vdev_dtl[DTL_TYPES]; /* dirty time logs */
297 space_map_t *vdev_dtl_sm; /* dirty time log space map */
34dc7c2f 298 txg_node_t vdev_dtl_node; /* per-txg dirty DTL linkage */
93cf2076
GW
299 uint64_t vdev_dtl_object; /* DTL object */
300 uint64_t vdev_psize; /* physical device capacity */
34dc7c2f
BB
301 uint64_t vdev_wholedisk; /* true if this is a whole disk */
302 uint64_t vdev_offline; /* persistent offline state */
303 uint64_t vdev_faulted; /* persistent faulted state */
304 uint64_t vdev_degraded; /* persistent degraded state */
305 uint64_t vdev_removed; /* persistent removed state */
5d1f7fb6 306 uint64_t vdev_resilver_txg; /* persistent resilvering state */
34dc7c2f
BB
307 uint64_t vdev_nparity; /* number of parity devices for raidz */
308 char *vdev_path; /* vdev path (if any) */
309 char *vdev_devid; /* vdev devid (if any) */
310 char *vdev_physpath; /* vdev device path (if any) */
1bbd8770 311 char *vdev_enc_sysfs_path; /* enclosure sysfs path */
9babb374 312 char *vdev_fru; /* physical FRU location */
b128c09f
BB
313 uint64_t vdev_not_present; /* not present during import */
314 uint64_t vdev_unspare; /* unspare when resilvering done */
b128c09f
BB
315 boolean_t vdev_nowritecache; /* true if flushwritecache failed */
316 boolean_t vdev_checkremove; /* temporary online test */
317 boolean_t vdev_forcefault; /* force online fault */
428870ff
BB
318 boolean_t vdev_splitting; /* split or repair in progress */
319 boolean_t vdev_delayed_close; /* delayed device close? */
93cf2076
GW
320 boolean_t vdev_tmpoffline; /* device taken offline temporarily? */
321 boolean_t vdev_detached; /* device detached? */
322 boolean_t vdev_cant_read; /* vdev is failing all reads */
323 boolean_t vdev_cant_write; /* vdev is failing all writes */
324 boolean_t vdev_isspare; /* was a hot spare */
325 boolean_t vdev_isl2cache; /* was a l2cache device */
9d3f7b87 326 boolean_t vdev_copy_uberblocks; /* post expand copy uberblocks */
34dc7c2f
BB
327 vdev_queue_t vdev_queue; /* I/O deadline schedule queue */
328 vdev_cache_t vdev_cache; /* physical block cache */
c3520e7f 329 spa_aux_vdev_t *vdev_aux; /* for l2cache and spares vdevs */
b128c09f 330 zio_t *vdev_probe_zio; /* root of current probe */
428870ff 331 vdev_aux_t vdev_label_aux; /* on-disk aux state */
e0ab3ab5 332 uint64_t vdev_leaf_zap;
379ca9cf 333 hrtime_t vdev_mmp_pending; /* 0 if write finished */
7088545d 334 uint64_t vdev_mmp_kstat_id; /* to find kstat entry */
34dc7c2f
BB
335
336 /*
337 * For DTrace to work in userland (libzpool) context, these fields must
338 * remain at the end of the structure. DTrace will use the kernel's
339 * CTF definition for 'struct vdev', and since the size of a kmutex_t is
9ae529ec 340 * larger in userland, the offsets for the rest of the fields would be
34dc7c2f
BB
341 * incorrect.
342 */
343 kmutex_t vdev_dtl_lock; /* vdev_dtl_{map,resilver} */
344 kmutex_t vdev_stat_lock; /* vdev_stat */
b128c09f 345 kmutex_t vdev_probe_lock; /* protects vdev_probe_zio */
6078881a
TH
346
347 /*
348 * We rate limit ZIO delay and ZIO checksum events, since they
349 * can flood ZED with tons of events when a drive is acting up.
350 */
6078881a
TH
351 zfs_ratelimit_t vdev_delay_rl;
352 zfs_ratelimit_t vdev_checksum_rl;
34dc7c2f
BB
353};
354
428870ff
BB
355#define VDEV_RAIDZ_MAXPARITY 3
356
9babb374
BB
357#define VDEV_PAD_SIZE (8 << 10)
358/* 2 padding areas (vl_pad1 and vl_pad2) to skip */
359#define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2
34dc7c2f
BB
360#define VDEV_PHYS_SIZE (112 << 10)
361#define VDEV_UBERBLOCK_RING (128 << 10)
362
379ca9cf
OF
363/*
364 * MMP blocks occupy the last MMP_BLOCKS_PER_LABEL slots in the uberblock
365 * ring when MMP is enabled.
366 */
367#define MMP_BLOCKS_PER_LABEL 1
368
b02fe35d
AR
369/* The largest uberblock we support is 8k. */
370#define MAX_UBERBLOCK_SHIFT (13)
34dc7c2f 371#define VDEV_UBERBLOCK_SHIFT(vd) \
b02fe35d
AR
372 MIN(MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT), \
373 MAX_UBERBLOCK_SHIFT)
34dc7c2f
BB
374#define VDEV_UBERBLOCK_COUNT(vd) \
375 (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
376#define VDEV_UBERBLOCK_OFFSET(vd, n) \
377 offsetof(vdev_label_t, vl_uberblock[(n) << VDEV_UBERBLOCK_SHIFT(vd)])
378#define VDEV_UBERBLOCK_SIZE(vd) (1ULL << VDEV_UBERBLOCK_SHIFT(vd))
379
34dc7c2f 380typedef struct vdev_phys {
428870ff
BB
381 char vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)];
382 zio_eck_t vp_zbt;
34dc7c2f
BB
383} vdev_phys_t;
384
385typedef struct vdev_label {
9babb374
BB
386 char vl_pad1[VDEV_PAD_SIZE]; /* 8K */
387 char vl_pad2[VDEV_PAD_SIZE]; /* 8K */
34dc7c2f
BB
388 vdev_phys_t vl_vdev_phys; /* 112K */
389 char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */
390} vdev_label_t; /* 256K total */
391
392/*
393 * vdev_dirty() flags
394 */
395#define VDD_METASLAB 0x01
396#define VDD_DTL 0x02
397
d3cc8b15
WA
398/* Offset of embedded boot loader region on each label */
399#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t))
34dc7c2f 400/*
d3cc8b15 401 * Size of embedded boot loader region on each label.
34dc7c2f
BB
402 * The total size of the first two labels plus the boot area is 4MB.
403 */
d3cc8b15 404#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */
34dc7c2f
BB
405
406/*
407 * Size of label regions at the start and end of each leaf device.
408 */
409#define VDEV_LABEL_START_SIZE (2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE)
410#define VDEV_LABEL_END_SIZE (2 * sizeof (vdev_label_t))
411#define VDEV_LABELS 4
9ae529ec 412#define VDEV_BEST_LABEL VDEV_LABELS
34dc7c2f
BB
413
414#define VDEV_ALLOC_LOAD 0
415#define VDEV_ALLOC_ADD 1
416#define VDEV_ALLOC_SPARE 2
417#define VDEV_ALLOC_L2CACHE 3
9babb374 418#define VDEV_ALLOC_ROOTPOOL 4
428870ff 419#define VDEV_ALLOC_SPLIT 5
5ffb9d1d 420#define VDEV_ALLOC_ATTACH 6
34dc7c2f
BB
421
422/*
423 * Allocate or free a vdev
424 */
428870ff
BB
425extern vdev_t *vdev_alloc_common(spa_t *spa, uint_t id, uint64_t guid,
426 vdev_ops_t *ops);
34dc7c2f
BB
427extern int vdev_alloc(spa_t *spa, vdev_t **vdp, nvlist_t *config,
428 vdev_t *parent, uint_t id, int alloctype);
429extern void vdev_free(vdev_t *vd);
430
431/*
432 * Add or remove children and parents
433 */
434extern void vdev_add_child(vdev_t *pvd, vdev_t *cvd);
435extern void vdev_remove_child(vdev_t *pvd, vdev_t *cvd);
436extern void vdev_compact_children(vdev_t *pvd);
437extern vdev_t *vdev_add_parent(vdev_t *cvd, vdev_ops_t *ops);
438extern void vdev_remove_parent(vdev_t *cvd);
439
440/*
441 * vdev sync load and sync
442 */
572e2857 443extern boolean_t vdev_log_state_valid(vdev_t *vd);
a1d477c2 444extern int vdev_load(vdev_t *vd);
93cf2076 445extern int vdev_dtl_load(vdev_t *vd);
34dc7c2f
BB
446extern void vdev_sync(vdev_t *vd, uint64_t txg);
447extern void vdev_sync_done(vdev_t *vd, uint64_t txg);
448extern void vdev_dirty(vdev_t *vd, int flags, void *arg, uint64_t txg);
93cf2076 449extern void vdev_dirty_leaves(vdev_t *vd, int flags, uint64_t txg);
34dc7c2f
BB
450
451/*
452 * Available vdev types.
453 */
454extern vdev_ops_t vdev_root_ops;
455extern vdev_ops_t vdev_mirror_ops;
456extern vdev_ops_t vdev_replacing_ops;
457extern vdev_ops_t vdev_raidz_ops;
458extern vdev_ops_t vdev_disk_ops;
459extern vdev_ops_t vdev_file_ops;
460extern vdev_ops_t vdev_missing_ops;
428870ff 461extern vdev_ops_t vdev_hole_ops;
34dc7c2f 462extern vdev_ops_t vdev_spare_ops;
a1d477c2 463extern vdev_ops_t vdev_indirect_ops;
34dc7c2f
BB
464
465/*
466 * Common size functions
467 */
468extern uint64_t vdev_default_asize(vdev_t *vd, uint64_t psize);
9babb374
BB
469extern uint64_t vdev_get_min_asize(vdev_t *vd);
470extern void vdev_set_min_asize(vdev_t *vd);
34dc7c2f
BB
471
472/*
d3cc8b15 473 * Global variables
34dc7c2f 474 */
d2734cce 475extern int vdev_standard_sm_blksz;
d3cc8b15 476/* zdb uses this tunable, so it must be declared here to make lint happy. */
34dc7c2f
BB
477extern int zfs_vdev_cache_size;
478
a1d477c2
MA
479/*
480 * Functions from vdev_indirect.c
481 */
482extern void vdev_indirect_sync_obsolete(vdev_t *vd, dmu_tx_t *tx);
483extern boolean_t vdev_indirect_should_condense(vdev_t *vd);
484extern void spa_condense_indirect_start_sync(vdev_t *vd, dmu_tx_t *tx);
485extern int vdev_obsolete_sm_object(vdev_t *vd);
486extern boolean_t vdev_obsolete_counts_are_precise(vdev_t *vd);
487
d2734cce
SD
488/*
489 * Other miscellaneous functions
490 */
491int vdev_checkpoint_sm_object(vdev_t *vd);
492
34dc7c2f
BB
493#ifdef __cplusplus
494}
495#endif
496
497#endif /* _SYS_VDEV_IMPL_H */