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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _SYS_DSL_DEADLIST_H
26 #define _SYS_DSL_DEADLIST_H
28 #include <sys/bpobj.h>
29 #include <sys/zfs_context.h>
38 typedef struct dsl_deadlist_phys {
42 uint64_t dl_pad[37]; /* pad out to 320b for future expansion */
43 } dsl_deadlist_phys_t;
45 typedef struct dsl_deadlist {
49 boolean_t dl_havetree;
50 struct dmu_buf *dl_dbuf;
51 dsl_deadlist_phys_t *dl_phys;
54 /* if it's the old on-disk format: */
59 typedef struct dsl_deadlist_entry {
63 } dsl_deadlist_entry_t;
65 void dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object);
66 void dsl_deadlist_close(dsl_deadlist_t *dl);
67 uint64_t dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx);
68 void dsl_deadlist_free(objset_t *os, uint64_t dlobj, dmu_tx_t *tx);
69 void dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx);
70 void dsl_deadlist_add_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx);
71 void dsl_deadlist_remove_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx);
72 uint64_t dsl_deadlist_clone(dsl_deadlist_t *dl, uint64_t maxtxg,
73 uint64_t mrs_obj, dmu_tx_t *tx);
74 void dsl_deadlist_space(dsl_deadlist_t *dl,
75 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);
76 void dsl_deadlist_space_range(dsl_deadlist_t *dl,
77 uint64_t mintxg, uint64_t maxtxg,
78 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);
79 void dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, dmu_tx_t *tx);
80 void dsl_deadlist_move_bpobj(dsl_deadlist_t *dl, bpobj_t *bpo, uint64_t mintxg,
87 #endif /* _SYS_DSL_DEADLIST_H */