3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011 by Delphix. All rights reserved.
24 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_DSL_DATASET_H
28 #define _SYS_DSL_DATASET_H
29
30 #include <sys/dmu.h>
31 #include <sys/spa.h>
32 #include <sys/txg.h>
33 #include <sys/zio.h>
34 #include <sys/bplist.h>
35 #include <sys/dsl_synctask.h>
36 #include <sys/zfs_context.h>
37 #include <sys/dsl_deadlist.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 struct dsl_dataset;
69 #define DS_FLAG_DEFER_DESTROY (1ULL<<3)
70 #define DS_IS_DEFER_DESTROY(ds) \
71 ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY)
72
73 /*
74 * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose
75 * name lookups should be performed case-insensitively.
76 */
77 #define DS_FLAG_CI_DATASET (1ULL<<16)
78
79 typedef struct dsl_dataset_phys {
80 uint64_t ds_dir_obj; /* DMU_OT_DSL_DIR */
81 uint64_t ds_prev_snap_obj; /* DMU_OT_DSL_DATASET */
82 uint64_t ds_prev_snap_txg;
83 uint64_t ds_next_snap_obj; /* DMU_OT_DSL_DATASET */
84 uint64_t ds_snapnames_zapobj; /* DMU_OT_DSL_DS_SNAP_MAP 0 for snaps */
85 uint64_t ds_num_children; /* clone/snap children; ==0 for head */
86 uint64_t ds_creation_time; /* seconds since 1970 */
87 uint64_t ds_creation_txg;
88 uint64_t ds_deadlist_obj; /* DMU_OT_DEADLIST */
89 uint64_t ds_used_bytes;
90 uint64_t ds_compressed_bytes;
91 uint64_t ds_uncompressed_bytes;
92 uint64_t ds_unique_bytes; /* only relevant to snapshots */
93 /*
94 * The ds_fsid_guid is a 56-bit ID that can change to avoid
95 * collisions. The ds_guid is a 64-bit ID that will never
96 * change, so there is a small probability that it will collide.
97 */
98 uint64_t ds_fsid_guid;
99 uint64_t ds_guid;
100 uint64_t ds_flags; /* DS_FLAG_* */
101 blkptr_t ds_bp;
102 uint64_t ds_next_clones_obj; /* DMU_OT_DSL_CLONES */
103 uint64_t ds_props_obj; /* DMU_OT_DSL_PROPS for snaps */
104 uint64_t ds_userrefs_obj; /* DMU_OT_USERREFS */
105 uint64_t ds_pad[5]; /* pad out to 320 bytes for good measure */
106 } dsl_dataset_phys_t;
107
108 typedef struct dsl_dataset {
109 /* Immutable: */
|
3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
24 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_DSL_DATASET_H
28 #define _SYS_DSL_DATASET_H
29
30 #include <sys/dmu.h>
31 #include <sys/spa.h>
32 #include <sys/txg.h>
33 #include <sys/zio.h>
34 #include <sys/bplist.h>
35 #include <sys/dsl_synctask.h>
36 #include <sys/zfs_context.h>
37 #include <sys/dsl_deadlist.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 struct dsl_dataset;
69 #define DS_FLAG_DEFER_DESTROY (1ULL<<3)
70 #define DS_IS_DEFER_DESTROY(ds) \
71 ((ds)->ds_phys->ds_flags & DS_FLAG_DEFER_DESTROY)
72
73 /*
74 * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose
75 * name lookups should be performed case-insensitively.
76 */
77 #define DS_FLAG_CI_DATASET (1ULL<<16)
78
79 typedef struct dsl_dataset_phys {
80 uint64_t ds_dir_obj; /* DMU_OT_DSL_DIR */
81 uint64_t ds_prev_snap_obj; /* DMU_OT_DSL_DATASET */
82 uint64_t ds_prev_snap_txg;
83 uint64_t ds_next_snap_obj; /* DMU_OT_DSL_DATASET */
84 uint64_t ds_snapnames_zapobj; /* DMU_OT_DSL_DS_SNAP_MAP 0 for snaps */
85 uint64_t ds_num_children; /* clone/snap children; ==0 for head */
86 uint64_t ds_creation_time; /* seconds since 1970 */
87 uint64_t ds_creation_txg;
88 uint64_t ds_deadlist_obj; /* DMU_OT_DEADLIST */
89 /*
90 * ds_referenced_bytes, ds_compressed_bytes, and ds_uncompressed_bytes
91 * include all blocks referenced by this dataset, including those
92 * shared with any other datasets.
93 */
94 uint64_t ds_referenced_bytes;
95 uint64_t ds_compressed_bytes;
96 uint64_t ds_uncompressed_bytes;
97 uint64_t ds_unique_bytes; /* only relevant to snapshots */
98 /*
99 * The ds_fsid_guid is a 56-bit ID that can change to avoid
100 * collisions. The ds_guid is a 64-bit ID that will never
101 * change, so there is a small probability that it will collide.
102 */
103 uint64_t ds_fsid_guid;
104 uint64_t ds_guid;
105 uint64_t ds_flags; /* DS_FLAG_* */
106 blkptr_t ds_bp;
107 uint64_t ds_next_clones_obj; /* DMU_OT_DSL_CLONES */
108 uint64_t ds_props_obj; /* DMU_OT_DSL_PROPS for snaps */
109 uint64_t ds_userrefs_obj; /* DMU_OT_USERREFS */
110 uint64_t ds_pad[5]; /* pad out to 320 bytes for good measure */
111 } dsl_dataset_phys_t;
112
113 typedef struct dsl_dataset {
114 /* Immutable: */
|