1*e86372a0SGvozden Neskovic /* 2*e86372a0SGvozden Neskovic * CDDL HEADER START 3*e86372a0SGvozden Neskovic * 4*e86372a0SGvozden Neskovic * The contents of this file are subject to the terms of the 5*e86372a0SGvozden Neskovic * Common Development and Distribution License (the "License"). 6*e86372a0SGvozden Neskovic * You may not use this file except in compliance with the License. 7*e86372a0SGvozden Neskovic * 8*e86372a0SGvozden Neskovic * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*e86372a0SGvozden Neskovic * or http://www.opensolaris.org/os/licensing. 10*e86372a0SGvozden Neskovic * See the License for the specific language governing permissions 11*e86372a0SGvozden Neskovic * and limitations under the License. 12*e86372a0SGvozden Neskovic * 13*e86372a0SGvozden Neskovic * When distributing Covered Code, include this CDDL HEADER in each 14*e86372a0SGvozden Neskovic * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*e86372a0SGvozden Neskovic * If applicable, add the following below this CDDL HEADER, with the 16*e86372a0SGvozden Neskovic * fields enclosed by brackets "[]" replaced with your own identifying 17*e86372a0SGvozden Neskovic * information: Portions Copyright [yyyy] [name of copyright owner] 18*e86372a0SGvozden Neskovic * 19*e86372a0SGvozden Neskovic * CDDL HEADER END 20*e86372a0SGvozden Neskovic */ 21*e86372a0SGvozden Neskovic /* 22*e86372a0SGvozden Neskovic * Copyright (C) 2016 Gvozden Neskovic <neskovic@compeng.uni-frankfurt.de>. 23*e86372a0SGvozden Neskovic * Copyright 2020 Joyent, Inc. 24*e86372a0SGvozden Neskovic */ 25*e86372a0SGvozden Neskovic 26*e86372a0SGvozden Neskovic #ifndef _SYS_VDEV_RAIDZ_H 27*e86372a0SGvozden Neskovic #define _SYS_VDEV_RAIDZ_H 28*e86372a0SGvozden Neskovic 29*e86372a0SGvozden Neskovic #include <sys/types.h> 30*e86372a0SGvozden Neskovic 31*e86372a0SGvozden Neskovic #ifdef __cplusplus 32*e86372a0SGvozden Neskovic extern "C" { 33*e86372a0SGvozden Neskovic #endif 34*e86372a0SGvozden Neskovic 35*e86372a0SGvozden Neskovic struct zio; 36*e86372a0SGvozden Neskovic struct raidz_map; 37*e86372a0SGvozden Neskovic #if !defined(_KERNEL) 38*e86372a0SGvozden Neskovic struct kernel_param {}; 39*e86372a0SGvozden Neskovic #endif 40*e86372a0SGvozden Neskovic 41*e86372a0SGvozden Neskovic /* 42*e86372a0SGvozden Neskovic * vdev_raidz interface 43*e86372a0SGvozden Neskovic */ 44*e86372a0SGvozden Neskovic struct raidz_map * vdev_raidz_map_alloc(struct zio *, uint64_t, 45*e86372a0SGvozden Neskovic uint64_t, uint64_t); 46*e86372a0SGvozden Neskovic void vdev_raidz_map_free(struct raidz_map *); 47*e86372a0SGvozden Neskovic void vdev_raidz_generate_parity(struct raidz_map *); 48*e86372a0SGvozden Neskovic int vdev_raidz_reconstruct(struct raidz_map *, const int *, int); 49*e86372a0SGvozden Neskovic 50*e86372a0SGvozden Neskovic /* 51*e86372a0SGvozden Neskovic * vdev_raidz_math interface 52*e86372a0SGvozden Neskovic */ 53*e86372a0SGvozden Neskovic void vdev_raidz_math_init(void); 54*e86372a0SGvozden Neskovic void vdev_raidz_math_fini(void); 55*e86372a0SGvozden Neskovic const struct raidz_impl_ops *vdev_raidz_math_get_ops(void); 56*e86372a0SGvozden Neskovic int vdev_raidz_math_generate(struct raidz_map *); 57*e86372a0SGvozden Neskovic int vdev_raidz_math_reconstruct(struct raidz_map *, const int *, 58*e86372a0SGvozden Neskovic const int *, const int); 59*e86372a0SGvozden Neskovic int vdev_raidz_impl_set(const char *); 60*e86372a0SGvozden Neskovic 61*e86372a0SGvozden Neskovic #ifdef __cplusplus 62*e86372a0SGvozden Neskovic } 63*e86372a0SGvozden Neskovic #endif 64*e86372a0SGvozden Neskovic 65*e86372a0SGvozden Neskovic #endif /* _SYS_VDEV_RAIDZ_H */ 66