FreeBSD ZFS
The Zettabyte File System
|
00001 /* 00002 * CDDL HEADER START 00003 * 00004 * The contents of this file are subject to the terms of the 00005 * Common Development and Distribution License (the "License"). 00006 * You may not use this file except in compliance with the License. 00007 * 00008 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 00009 * or http://www.opensolaris.org/os/licensing. 00010 * See the License for the specific language governing permissions 00011 * and limitations under the License. 00012 * 00013 * When distributing Covered Code, include this CDDL HEADER in each 00014 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 00015 * If applicable, add the following below this CDDL HEADER, with the 00016 * fields enclosed by brackets "[]" replaced with your own identifying 00017 * information: Portions Copyright [yyyy] [name of copyright owner] 00018 * 00019 * CDDL HEADER END 00020 */ 00021 /* 00022 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 00023 */ 00024 00025 #ifndef _SYS_BPLIST_H 00026 #define _SYS_BPLIST_H 00027 00028 #include <sys/zfs_context.h> 00029 #include <sys/spa.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 typedef struct bplist_entry { 00036 blkptr_t bpe_blk; 00037 list_node_t bpe_node; 00038 } bplist_entry_t; 00039 00040 typedef struct bplist { 00041 kmutex_t bpl_lock; 00042 list_t bpl_list; 00043 } bplist_t; 00044 00045 typedef int bplist_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); 00046 00047 void bplist_create(bplist_t *bpl); 00048 void bplist_destroy(bplist_t *bpl); 00049 void bplist_append(bplist_t *bpl, const blkptr_t *bp); 00050 void bplist_iterate(bplist_t *bpl, bplist_itor_t *func, 00051 void *arg, dmu_tx_t *tx); 00052 00053 #ifdef __cplusplus 00054 } 00055 #endif 00056 00057 #endif /* _SYS_BPLIST_H */