vdev.h revision 3d7072f8bd27709dba14f6fe336f149d25d9e207
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling * Common Development and Distribution License (the "License").
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling * 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
39c23413b8df94a95f67b34cfd4a4dfc3fd0b48deschrock * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
fa9e4066f08beec538e775443c5be79dd423fcabahrens#pragma ident "%Z%%M% %I% %E% SMI"
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Fault injection modes.
99653d4ee642c6528e88224f12409a5f23060994eschrockextern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern vdev_t *vdev_lookup_top(spa_t *spa, uint64_t vdev);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern vdev_t *vdev_lookup_by_guid(vdev_t *vd, uint64_t guid);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern void vdev_dtl_dirty(space_map_t *sm, uint64_t txg, uint64_t size);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern int vdev_dtl_contains(space_map_t *sm, uint64_t txg, uint64_t size);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern void vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg,
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern int vdev_metaslab_init(vdev_t *vd, uint64_t txg);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern void vdev_scrub_stat_update(vdev_t *vd, pool_scrub_type_t type,
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern int vdev_getspec(spa_t *spa, uint64_t vdev, char **vdev_spec);
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockextern void vdev_set_state(vdev_t *vd, boolean_t isopen, vdev_state_t state,
99653d4ee642c6528e88224f12409a5f23060994eschrockextern void vdev_space_update(vdev_t *vd, int64_t space_delta,
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern uint64_t vdev_psize_to_asize(vdev_t *vd, uint64_t psize);
3d7072f8bd27709dba14f6fe336f149d25d9e207eschrockextern int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags,
3d7072f8bd27709dba14f6fe336f149d25d9e207eschrockextern int vdev_offline(spa_t *spa, uint64_t guid, uint64_t flags);
0373e76b3c3643df49ef3483e0f293fdea61d8c6bonwickextern int vdev_config_sync(vdev_t *vd, uint64_t txg);
99653d4ee642c6528e88224f12409a5f23060994eschrockextern nvlist_t *vdev_config_generate(spa_t *spa, vdev_t *vd,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Label routines
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset);
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern void vdev_uberblock_load(zio_t *zio, vdev_t *vd, struct uberblock *ub);
39c23413b8df94a95f67b34cfd4a4dfc3fd0b48deschrocktypedef enum {
39c23413b8df94a95f67b34cfd4a4dfc3fd0b48deschrock VDEV_LABEL_REPLACE, /* replace an existing device */
39c23413b8df94a95f67b34cfd4a4dfc3fd0b48deschrockextern int vdev_label_init(vdev_t *vd, uint64_t txg, vdev_labeltype_t reason);
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_VDEV_H */