]>
git.proxmox.com Git - mirror_zfs.git/blob - include/sys/ddt_impl.h
09937c714615849dba1d252d3803e53450115686
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 https://opensource.org/licenses/CDDL-1.0.
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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2016 by Delphix. All rights reserved.
24 * Copyright (c) 2023, Klara Inc.
27 #ifndef _SYS_DDT_IMPL_H
28 #define _SYS_DDT_IMPL_H
37 * Ops vector to access a specific DDT object type.
41 int (*ddt_op_create
)(objset_t
*os
, uint64_t *object
, dmu_tx_t
*tx
,
43 int (*ddt_op_destroy
)(objset_t
*os
, uint64_t object
, dmu_tx_t
*tx
);
44 int (*ddt_op_lookup
)(objset_t
*os
, uint64_t object
, ddt_entry_t
*dde
);
45 void (*ddt_op_prefetch
)(objset_t
*os
, uint64_t object
,
47 int (*ddt_op_update
)(objset_t
*os
, uint64_t object
, ddt_entry_t
*dde
,
49 int (*ddt_op_remove
)(objset_t
*os
, uint64_t object
, ddt_entry_t
*dde
,
51 int (*ddt_op_walk
)(objset_t
*os
, uint64_t object
, ddt_entry_t
*dde
,
53 int (*ddt_op_count
)(objset_t
*os
, uint64_t object
, uint64_t *count
);
56 extern const ddt_ops_t ddt_zap_ops
;
58 extern void ddt_stat_update(ddt_t
*ddt
, ddt_entry_t
*dde
, uint64_t neg
);
61 * These are only exposed so that zdb can access them. Try not to use them
62 * outside of the DDT implementation proper, and if you do, consider moving
65 #define DDT_NAMELEN 107
67 extern uint64_t ddt_phys_total_refcnt(const ddt_entry_t
*dde
);
69 extern void ddt_key_fill(ddt_key_t
*ddk
, const blkptr_t
*bp
);
71 extern void ddt_stat_add(ddt_stat_t
*dst
, const ddt_stat_t
*src
, uint64_t neg
);
73 extern void ddt_object_name(ddt_t
*ddt
, ddt_type_t type
, ddt_class_t clazz
,
75 extern int ddt_object_walk(ddt_t
*ddt
, ddt_type_t type
, ddt_class_t clazz
,
76 uint64_t *walk
, ddt_entry_t
*dde
);
77 extern int ddt_object_count(ddt_t
*ddt
, ddt_type_t type
, ddt_class_t clazz
,
79 extern int ddt_object_info(ddt_t
*ddt
, ddt_type_t type
, ddt_class_t clazz
,
86 #endif /* _SYS_DDT_H */