1 // SPDX-License-Identifier: CDDL-1.0 2 /* 3 * CDDL HEADER START 4 * 5 * The contents of this file are subject to the terms of the 6 * Common Development and Distribution License (the "License"). 7 * You may not use this file except in compliance with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or https://opensource.org/licenses/CDDL-1.0. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 24 * Copyright (c) 2018 by Delphix. All rights reserved. 25 */ 26 27 #ifndef _SYS_BPLIST_H 28 #define _SYS_BPLIST_H 29 30 #include <sys/zfs_context.h> 31 #include <sys/spa.h> 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 typedef struct bplist_entry { 38 blkptr_t bpe_blk; 39 list_node_t bpe_node; 40 } bplist_entry_t; 41 42 typedef struct bplist { 43 kmutex_t bpl_lock; 44 list_t bpl_list; 45 } bplist_t; 46 47 typedef int bplist_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); 48 49 void bplist_create(bplist_t *bpl); 50 void bplist_destroy(bplist_t *bpl); 51 void bplist_append(bplist_t *bpl, const blkptr_t *bp); 52 void bplist_iterate(bplist_t *bpl, bplist_itor_t *func, 53 void *arg, dmu_tx_t *tx); 54 void bplist_clear(bplist_t *bpl); 55 56 #ifdef __cplusplus 57 } 58 #endif 59 60 #endif /* _SYS_BPLIST_H */ 61