annotate usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h @ 11007:216d8396182e

PSARC/2009/557 ZFS send dedup 6812638 zfs send intra-stream dedup 6887817 want snapshot filtering for zfs send 6812603 zfs send can aggregate free records
author Lori Alt <Lori.Alt@Sun.COM>
date Mon, 09 Nov 2009 11:04:55 -0700
parents 8aac17999e4d
children 462283cb4096
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
1 /*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
2 * CDDL HEADER START
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
3 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
5 * Common Development and Distribution License (the "License").
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
6 * You may not use this file except in compliance with the License.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
7 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
10 * See the License for the specific language governing permissions
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
11 * and limitations under the License.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
12 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
18 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
19 * CDDL HEADER END
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
20 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
21 /*
8934
8ff6afa44187 6709704 smbtorture RAW-BENCH-OPLOCK test fails (when oplocks enabled)
jose borrego <Jose.Borrego@Sun.COM>
parents: 6492
diff changeset
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
23 * Use is subject to license terms.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
24 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
25
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
26 #ifndef _SYS_ZFS_IOCTL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
27 #define _SYS_ZFS_IOCTL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
28
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
29 #include <sys/cred.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
30 #include <sys/dmu.h>
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
31 #include <sys/zio.h>
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
32 #include <sys/dsl_deleg.h>
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
33 #include <sys/spa.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
34
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
35 #ifdef _KERNEL
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
36 #include <sys/nvpair.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
37 #endif /* _KERNEL */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
38
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
39 #ifdef __cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
40 extern "C" {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
41 #endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
42
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
43 /*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
44 * Property values for snapdir
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
45 */
849
8d799fd81a9b 6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents: 789
diff changeset
46 #define ZFS_SNAPDIR_HIDDEN 0
8d799fd81a9b 6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents: 789
diff changeset
47 #define ZFS_SNAPDIR_VISIBLE 1
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
48
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
49 /*
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
50 * Field manipulation macros for the drr_versioninfo field of the
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
51 * send stream header.
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
52 */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
53
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
54 /*
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
55 * Header types for zfs send streams.
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
56 */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
57 typedef enum drr_headertype {
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
58 DMU_SUBSTREAM = 0x1,
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
59 DMU_COMPOUNDSTREAM = 0x2
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
60 } drr_headertype_t;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
61
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
62 #define DMU_GET_STREAM_HDRTYPE(vi) BF64_GET((vi), 0, 2)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
63 #define DMU_SET_STREAM_HDRTYPE(vi, x) BF64_SET((vi), 0, 2, x)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
64
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
65 #define DMU_GET_FEATUREFLAGS(vi) BF64_GET((vi), 2, 30)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
66 #define DMU_SET_FEATUREFLAGS(vi, x) BF64_SET((vi), 2, 30, x)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
67
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
68 /*
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
69 * Feature flags for zfs send streams (flags in drr_versioninfo)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
70 */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
71
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
72 #define DMU_BACKUP_FEATURE_DEDUP (0x1)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
73
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
74 /*
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
75 * Mask of all supported backup features
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
76 */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
77 #define DMU_BACKUP_FEATURE_MASK (DMU_BACKUP_FEATURE_DEDUP)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
78
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
79 /* Are all features in the given flag word currently supported? */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
80 #define DMU_STREAM_SUPPORTED(x) (!((x) & ~DMU_BACKUP_FEATURE_MASK))
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
81
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
82 /*
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
83 * The drr_versioninfo field of the dmu_replay_record has the
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
84 * following layout:
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
85 *
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
86 * 64 56 48 40 32 24 16 8 0
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
87 * +-------+-------+-------+-------+-------+-------+-------+-------+
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
88 * | reserved | feature-flags |C|S|
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
89 * +-------+-------+-------+-------+-------+-------+-------+-------+
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
90 *
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
91 * The low order two bits indicate the header type: SUBSTREAM (0x1)
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
92 * or COMPOUNDSTREAM (0x2). Using two bits for this is historical:
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
93 * this field used to be a version number, where the two version types
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
94 * were 1 and 2. Using two bits for this allows earlier versions of
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
95 * the code to be able to recognize send streams that don't use any
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
96 * of the features indicated by feature flags.
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
97 */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
98
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
99 #define DMU_BACKUP_MAGIC 0x2F5bacbacULL
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
100
6492
903545192033 6654808 FIGNORECASE lookups in a zfs xattr dir don't provide 'realname' data
timh
parents: 5498
diff changeset
101 #define DRR_FLAG_CLONE (1<<0)
903545192033 6654808 FIGNORECASE lookups in a zfs xattr dir don't provide 'realname' data
timh
parents: 5498
diff changeset
102 #define DRR_FLAG_CI_DATA (1<<1)
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
103
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
104 /*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
105 * zfs ioctl command structure
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
106 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
107 typedef struct dmu_replay_record {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
108 enum {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
109 DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
110 DRR_WRITE, DRR_FREE, DRR_END, DRR_WRITE_BYREF,
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
111 DRR_NUMTYPES
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
112 } drr_type;
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
113 uint32_t drr_payloadlen;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
114 union {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
115 struct drr_begin {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
116 uint64_t drr_magic;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
117 uint64_t drr_versioninfo; /* was drr_version */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
118 uint64_t drr_creation_time;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
119 dmu_objset_type_t drr_type;
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
120 uint32_t drr_flags;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
121 uint64_t drr_toguid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
122 uint64_t drr_fromguid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
123 char drr_toname[MAXNAMELEN];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
124 } drr_begin;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
125 struct drr_end {
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
126 zio_cksum_t drr_checksum;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
127 uint64_t drr_toguid;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
128 } drr_end;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
129 struct drr_object {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
130 uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
131 dmu_object_type_t drr_type;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
132 dmu_object_type_t drr_bonustype;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
133 uint32_t drr_blksz;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
134 uint32_t drr_bonuslen;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
135 uint8_t drr_checksumtype;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
136 uint8_t drr_compress;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
137 uint8_t drr_pad[6];
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
138 uint64_t drr_toguid;
2885
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
139 /* bonus content follows */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
140 } drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
141 struct drr_freeobjects {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
142 uint64_t drr_firstobj;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
143 uint64_t drr_numobjs;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
144 uint64_t drr_toguid;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
145 } drr_freeobjects;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
146 struct drr_write {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
147 uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
148 dmu_object_type_t drr_type;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
149 uint32_t drr_pad;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
150 uint64_t drr_offset;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
151 uint64_t drr_length;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
152 uint64_t drr_toguid;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
153 uint8_t drr_checksumtype;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
154 uint8_t drr_pad2[7];
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
155 zio_cksum_t drr_blkcksum;
2885
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
156 /* content follows */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
157 } drr_write;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
158 struct drr_free {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
159 uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
160 uint64_t drr_offset;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
161 uint64_t drr_length;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
162 uint64_t drr_toguid;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
163 } drr_free;
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
164 struct drr_write_byref {
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
165 /* where to put the data */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
166 uint64_t drr_object;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
167 uint64_t drr_offset;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
168 uint64_t drr_length;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
169 uint64_t drr_toguid;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
170 /* where to find the prior copy of the data */
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
171 uint64_t drr_refguid;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
172 uint64_t drr_refobject;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
173 uint64_t drr_refoffset;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
174 uint8_t drr_checksumtype;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
175 uint8_t drr_pad[7];
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
176 zio_cksum_t drr_blkcksum;
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
177 } drr_write_byref;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
178 } drr_u;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
179 } dmu_replay_record_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
180
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
181 typedef struct zinject_record {
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
182 uint64_t zi_objset;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
183 uint64_t zi_object;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
184 uint64_t zi_start;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
185 uint64_t zi_end;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
186 uint64_t zi_guid;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
187 uint32_t zi_level;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
188 uint32_t zi_error;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
189 uint64_t zi_type;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
190 uint32_t zi_freq;
9725
0bf7402e8022 6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 9643
diff changeset
191 uint32_t zi_failfast;
10594
986cb68d2347 6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents: 10342
diff changeset
192 char zi_func[MAXNAMELEN];
10685
931790026ac6 6846163 ZFS continues to use faulted logzilla, bringing system to a crawl
George Wilson <George.Wilson@Sun.COM>
parents: 10602
diff changeset
193 uint32_t zi_iotype;
10921
8aac17999e4d PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents: 10685
diff changeset
194 int32_t zi_duration;
8aac17999e4d PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents: 10685
diff changeset
195 uint64_t zi_timer;
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
196 } zinject_record_t;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
197
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
198 #define ZINJECT_NULL 0x1
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
199 #define ZINJECT_FLUSH_ARC 0x2
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
200 #define ZINJECT_UNLOAD_SPA 0x4
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
201
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
202 typedef struct zfs_share {
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
203 uint64_t z_exportdata;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
204 uint64_t z_sharedata;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
205 uint64_t z_sharetype; /* 0 = share, 1 = unshare */
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
206 uint64_t z_sharemax; /* max length of share string */
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
207 } zfs_share_t;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
208
5498
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
209 /*
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
210 * ZFS file systems may behave the usual, POSIX-compliant way, where
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
211 * name lookups are case-sensitive. They may also be set up so that
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
212 * all the name lookups are case-insensitive, or so that only some
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
213 * lookups, the ones that set an FIGNORECASE flag, are case-insensitive.
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
214 */
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
215 typedef enum zfs_case {
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
216 ZFS_CASE_SENSITIVE,
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
217 ZFS_CASE_INSENSITIVE,
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
218 ZFS_CASE_MIXED
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
219 } zfs_case_t;
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
220
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
221 typedef struct zfs_cmd {
2467
9829873580a5 6443585 zpool create of poolname > 250 and < 256 characters panics in debug printout
ek110237
parents: 1544
diff changeset
222 char zc_name[MAXPATHLEN];
3444
dc160a70a50d 6410433 'zpool status -v' would be more useful with filenames
ek110237
parents: 2926
diff changeset
223 char zc_value[MAXPATHLEN * 2];
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
224 char zc_string[MAXNAMELEN];
11007
216d8396182e PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents: 10921
diff changeset
225 char zc_top_ds[MAXPATHLEN];
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
226 uint64_t zc_guid;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
227 uint64_t zc_nvlist_conf; /* really (char *) */
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
228 uint64_t zc_nvlist_conf_size;
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
229 uint64_t zc_nvlist_src; /* really (char *) */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2467
diff changeset
230 uint64_t zc_nvlist_src_size;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
231 uint64_t zc_nvlist_dst; /* really (char *) */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2467
diff changeset
232 uint64_t zc_nvlist_dst_size;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
233 uint64_t zc_cookie;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
234 uint64_t zc_objset_type;
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
235 uint64_t zc_perm_action;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
236 uint64_t zc_history; /* really (char *) */
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
237 uint64_t zc_history_len;
2926
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2885
diff changeset
238 uint64_t zc_history_offset;
3444
dc160a70a50d 6410433 'zpool status -v' would be more useful with filenames
ek110237
parents: 2926
diff changeset
239 uint64_t zc_obj;
9643
ffd8e7765f02 6736004 zvols need an additional property for comstar support
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 9396
diff changeset
240 uint64_t zc_iflags; /* internal to zfs(7fs) */
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
241 zfs_share_t zc_share;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
242 dmu_objset_stats_t zc_objset_stats;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
243 struct drr_begin zc_begin_record;
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
244 zinject_record_t zc_inject_record;
10242
c40d075fbca6 PSARC/2009/297 zfs snapshot holds
Chris Kirby <chris.kirby@sun.com>
parents: 9725
diff changeset
245 boolean_t zc_defer_destroy;
10342
108f0058f837 6833815 scheduled snapshots deleted per snapshot policy can lead to replication failures
Chris Kirby <chris.kirby@sun.com>
parents: 10242
diff changeset
246 boolean_t zc_temphold;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
247 } zfs_cmd_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
248
9396
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
249 typedef struct zfs_useracct {
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
250 char zu_domain[256];
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
251 uid_t zu_rid;
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
252 uint32_t zu_pad;
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
253 uint64_t zu_space;
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
254 } zfs_useracct_t;
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8934
diff changeset
255
849
8d799fd81a9b 6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents: 789
diff changeset
256 #define ZVOL_MAX_MINOR (1 << 16)
8d799fd81a9b 6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents: 789
diff changeset
257 #define ZFS_MIN_MINOR (ZVOL_MAX_MINOR + 1)
8d799fd81a9b 6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents: 789
diff changeset
258
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
259 #ifdef _KERNEL
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
260
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
261 typedef struct zfs_creat {
5498
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5367
diff changeset
262 nvlist_t *zct_zplprops;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
263 nvlist_t *zct_props;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
264 } zfs_creat_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
265
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
266 extern dev_info_t *zfs_dip;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
267
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
268 extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
269 extern int zfs_secpolicy_rename_perms(const char *from,
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
270 const char *to, cred_t *cr);
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
271 extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
272 extern int zfs_busy(void);
4007
c6f5c6753018 PSARC 2007/142 zfs rename -r
mmusante
parents: 3444
diff changeset
273 extern int zfs_unmount_snap(char *, void *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
274
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
275 #endif /* _KERNEL */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
276
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
277 #ifdef __cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
278 }
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
279 #endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
280
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
281 #endif /* _SYS_ZFS_IOCTL_H */