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) 2010, Oracle and/or its affiliates. All rights reserved. 00023 */ 00024 00025 #ifndef _SYS_DSL_DEADLIST_H 00026 #define _SYS_DSL_DEADLIST_H 00027 00028 #include <sys/bpobj.h> 00029 #include <sys/zfs_context.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 struct dmu_buf; 00036 struct dsl_dataset; 00037 00038 typedef struct dsl_deadlist_phys { 00039 uint64_t dl_used; 00040 uint64_t dl_comp; 00041 uint64_t dl_uncomp; 00042 uint64_t dl_pad[37]; 00043 } dsl_deadlist_phys_t; 00044 00045 typedef struct dsl_deadlist { 00046 objset_t *dl_os; 00047 uint64_t dl_object; 00048 avl_tree_t dl_tree; 00049 boolean_t dl_havetree; 00050 struct dmu_buf *dl_dbuf; 00051 dsl_deadlist_phys_t *dl_phys; 00052 kmutex_t dl_lock; 00053 00055 bpobj_t dl_bpobj; 00056 boolean_t dl_oldfmt; 00057 } dsl_deadlist_t; 00058 00059 typedef struct dsl_deadlist_entry { 00060 avl_node_t dle_node; 00061 uint64_t dle_mintxg; 00062 bpobj_t dle_bpobj; 00063 } dsl_deadlist_entry_t; 00064 00065 void dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object); 00066 void dsl_deadlist_close(dsl_deadlist_t *dl); 00067 uint64_t dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx); 00068 void dsl_deadlist_free(objset_t *os, uint64_t dlobj, dmu_tx_t *tx); 00069 void dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx); 00070 void dsl_deadlist_add_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx); 00071 void dsl_deadlist_remove_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx); 00072 uint64_t dsl_deadlist_clone(dsl_deadlist_t *dl, uint64_t maxtxg, 00073 uint64_t mrs_obj, dmu_tx_t *tx); 00074 void dsl_deadlist_space(dsl_deadlist_t *dl, 00075 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); 00076 void dsl_deadlist_space_range(dsl_deadlist_t *dl, 00077 uint64_t mintxg, uint64_t maxtxg, 00078 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); 00079 void dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, dmu_tx_t *tx); 00080 void dsl_deadlist_move_bpobj(dsl_deadlist_t *dl, bpobj_t *bpo, uint64_t mintxg, 00081 dmu_tx_t *tx); 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif /* _SYS_DSL_DEADLIST_H */