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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
32 #include <sys/zfs_context.h>
38 typedef struct bplist_phys {
40 * This is the bonus buffer for the dead lists. The object's
41 * contents is an array of bpl_entries blkptr_t's, representing
42 * a total of bpl_bytes physical space.
50 #define BPLIST_SIZE_V0 (2 * sizeof (uint64_t))
52 typedef struct bplist_q {
57 typedef struct bplist {
61 uint8_t bpl_blockshift;
64 bplist_q_t *bpl_queue;
65 bplist_phys_t *bpl_phys;
67 dmu_buf_t *bpl_cached_dbuf;
70 extern uint64_t bplist_create(objset_t *mos, int blocksize, dmu_tx_t *tx);
71 extern void bplist_destroy(objset_t *mos, uint64_t object, dmu_tx_t *tx);
72 extern int bplist_open(bplist_t *bpl, objset_t *mos, uint64_t object);
73 extern void bplist_close(bplist_t *bpl);
74 extern boolean_t bplist_empty(bplist_t *bpl);
75 extern int bplist_iterate(bplist_t *bpl, uint64_t *itorp, blkptr_t *bp);
76 extern int bplist_enqueue(bplist_t *bpl, const blkptr_t *bp, dmu_tx_t *tx);
77 extern void bplist_enqueue_deferred(bplist_t *bpl, const blkptr_t *bp);
78 extern void bplist_sync(bplist_t *bpl, dmu_tx_t *tx);
79 extern void bplist_vacate(bplist_t *bpl, dmu_tx_t *tx);
80 extern int bplist_space(bplist_t *bpl,
81 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);
82 extern int bplist_space_birthrange(bplist_t *bpl,
83 uint64_t mintxg, uint64_t maxtxg, uint64_t *dasizep);
89 #endif /* _SYS_BPLIST_H */