author | Chris Kirby <Chris.Kirby@oracle.com> |
Wed, 07 Jul 2010 15:04:13 -0600 | |
changeset 12798 | f6c8601080b4 |
parent 12527 | 693dd2cad55f |
child 13055 | 8c712bbb18ea |
permissions | -rw-r--r-- |
789 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
1544 | 5 |
* Common Development and Distribution License (the "License"). |
6 |
* You may not use this file except in compliance with the License. |
|
789 | 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 |
/* |
|
12527
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
22 |
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
789 | 23 |
*/ |
24 |
||
25 |
#ifndef _SYS_ZFS_IOCTL_H |
|
26 |
#define _SYS_ZFS_IOCTL_H |
|
27 |
||
28 |
#include <sys/cred.h> |
|
29 |
#include <sys/dmu.h> |
|
1544 | 30 |
#include <sys/zio.h> |
4543 | 31 |
#include <sys/dsl_deleg.h> |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
32 |
#include <sys/spa.h> |
789 | 33 |
|
5331 | 34 |
#ifdef _KERNEL |
35 |
#include <sys/nvpair.h> |
|
36 |
#endif /* _KERNEL */ |
|
37 |
||
789 | 38 |
#ifdef __cplusplus |
39 |
extern "C" { |
|
40 |
#endif |
|
41 |
||
42 |
/* |
|
43 |
* Property values for snapdir |
|
44 |
*/ |
|
849
8d799fd81a9b
6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents:
789
diff
changeset
|
45 |
#define ZFS_SNAPDIR_HIDDEN 0 |
8d799fd81a9b
6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents:
789
diff
changeset
|
46 |
#define ZFS_SNAPDIR_VISIBLE 1 |
789 | 47 |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
48 |
/* |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
49 |
* 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
|
50 |
* send stream header. |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
51 |
*/ |
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 |
* Header types for zfs send streams. |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
55 |
*/ |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
56 |
typedef enum drr_headertype { |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
57 |
DMU_SUBSTREAM = 0x1, |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
58 |
DMU_COMPOUNDSTREAM = 0x2 |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
59 |
} drr_headertype_t; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
60 |
|
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
61 |
#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
|
62 |
#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
|
63 |
|
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
64 |
#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
|
65 |
#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
|
66 |
|
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 |
* 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
|
69 |
*/ |
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 |
#define DMU_BACKUP_FEATURE_DEDUP (0x1) |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
72 |
#define DMU_BACKUP_FEATURE_DEDUPPROPS (0x2) |
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
73 |
#define DMU_BACKUP_FEATURE_SA_SPILL (0x4) |
11007
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 |
/* |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
76 |
* Mask of all supported backup features |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
77 |
*/ |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
78 |
#define DMU_BACKUP_FEATURE_MASK (DMU_BACKUP_FEATURE_DEDUP | \ |
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
79 |
DMU_BACKUP_FEATURE_DEDUPPROPS | DMU_BACKUP_FEATURE_SA_SPILL) |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
80 |
|
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
81 |
/* 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
|
82 |
#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
|
83 |
|
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
84 |
/* |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
85 |
* 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
|
86 |
* following layout: |
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 |
* 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
|
89 |
* +-------+-------+-------+-------+-------+-------+-------+-------+ |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
90 |
* | reserved | feature-flags |C|S| |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
91 |
* +-------+-------+-------+-------+-------+-------+-------+-------+ |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
92 |
* |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
93 |
* 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
|
94 |
* 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
|
95 |
* 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
|
96 |
* 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
|
97 |
* 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
|
98 |
* of the features indicated by feature flags. |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
99 |
*/ |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
100 |
|
789 | 101 |
#define DMU_BACKUP_MAGIC 0x2F5bacbacULL |
102 |
||
6492
903545192033
6654808 FIGNORECASE lookups in a zfs xattr dir don't provide 'realname' data
timh
parents:
5498
diff
changeset
|
103 |
#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
|
104 |
#define DRR_FLAG_CI_DATA (1<<1) |
5367 | 105 |
|
789 | 106 |
/* |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
107 |
* flags in the drr_checksumflags field in the DRR_WRITE and |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
108 |
* DRR_WRITE_BYREF blocks |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
109 |
*/ |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
110 |
#define DRR_CHECKSUM_DEDUP (1<<0) |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
111 |
|
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
112 |
#define DRR_IS_DEDUP_CAPABLE(flags) ((flags) & DRR_CHECKSUM_DEDUP) |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
113 |
|
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
114 |
/* |
789 | 115 |
* zfs ioctl command structure |
116 |
*/ |
|
117 |
typedef struct dmu_replay_record { |
|
118 |
enum { |
|
119 |
DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS, |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
120 |
DRR_WRITE, DRR_FREE, DRR_END, DRR_WRITE_BYREF, |
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
121 |
DRR_SPILL, DRR_NUMTYPES |
789 | 122 |
} drr_type; |
5367 | 123 |
uint32_t drr_payloadlen; |
789 | 124 |
union { |
125 |
struct drr_begin { |
|
126 |
uint64_t drr_magic; |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
127 |
uint64_t drr_versioninfo; /* was drr_version */ |
789 | 128 |
uint64_t drr_creation_time; |
129 |
dmu_objset_type_t drr_type; |
|
5367 | 130 |
uint32_t drr_flags; |
789 | 131 |
uint64_t drr_toguid; |
132 |
uint64_t drr_fromguid; |
|
133 |
char drr_toname[MAXNAMELEN]; |
|
134 |
} drr_begin; |
|
135 |
struct drr_end { |
|
1544 | 136 |
zio_cksum_t drr_checksum; |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
137 |
uint64_t drr_toguid; |
789 | 138 |
} drr_end; |
139 |
struct drr_object { |
|
140 |
uint64_t drr_object; |
|
141 |
dmu_object_type_t drr_type; |
|
142 |
dmu_object_type_t drr_bonustype; |
|
143 |
uint32_t drr_blksz; |
|
144 |
uint32_t drr_bonuslen; |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
145 |
uint8_t drr_checksumtype; |
789 | 146 |
uint8_t drr_compress; |
147 |
uint8_t drr_pad[6]; |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
148 |
uint64_t drr_toguid; |
2885 | 149 |
/* bonus content follows */ |
789 | 150 |
} drr_object; |
151 |
struct drr_freeobjects { |
|
152 |
uint64_t drr_firstobj; |
|
153 |
uint64_t drr_numobjs; |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
154 |
uint64_t drr_toguid; |
789 | 155 |
} drr_freeobjects; |
156 |
struct drr_write { |
|
157 |
uint64_t drr_object; |
|
158 |
dmu_object_type_t drr_type; |
|
159 |
uint32_t drr_pad; |
|
160 |
uint64_t drr_offset; |
|
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; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
163 |
uint8_t drr_checksumtype; |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
164 |
uint8_t drr_checksumflags; |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
165 |
uint8_t drr_pad2[6]; |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
166 |
ddt_key_t drr_key; /* deduplication key */ |
2885 | 167 |
/* content follows */ |
789 | 168 |
} drr_write; |
169 |
struct drr_free { |
|
170 |
uint64_t drr_object; |
|
171 |
uint64_t drr_offset; |
|
172 |
uint64_t drr_length; |
|
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
173 |
uint64_t drr_toguid; |
789 | 174 |
} drr_free; |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
175 |
struct drr_write_byref { |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
176 |
/* where to put the data */ |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
177 |
uint64_t drr_object; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
178 |
uint64_t drr_offset; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
179 |
uint64_t drr_length; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
180 |
uint64_t drr_toguid; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
181 |
/* 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
|
182 |
uint64_t drr_refguid; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
183 |
uint64_t drr_refobject; |
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
184 |
uint64_t drr_refoffset; |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
185 |
/* properties of the data */ |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
186 |
uint8_t drr_checksumtype; |
11381
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
187 |
uint8_t drr_checksumflags; |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
188 |
uint8_t drr_pad2[6]; |
c77e4d2b2e75
6907006 zfs over-the-wire dedup recalculates checksums unnecessarily
Lori Alt <Lori.Alt@Sun.COM>
parents:
11209
diff
changeset
|
189 |
ddt_key_t drr_key; /* deduplication key */ |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
190 |
} drr_write_byref; |
11935
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
191 |
struct drr_spill { |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
192 |
uint64_t drr_object; |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
193 |
uint64_t drr_length; |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
194 |
uint64_t drr_toguid; |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
195 |
uint64_t drr_pad[4]; /* needed for crypto */ |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
196 |
/* spill data follows */ |
538c866aaac6
6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents:
11422
diff
changeset
|
197 |
} drr_spill; |
789 | 198 |
} drr_u; |
199 |
} dmu_replay_record_t; |
|
200 |
||
1544 | 201 |
typedef struct zinject_record { |
202 |
uint64_t zi_objset; |
|
203 |
uint64_t zi_object; |
|
204 |
uint64_t zi_start; |
|
205 |
uint64_t zi_end; |
|
206 |
uint64_t zi_guid; |
|
207 |
uint32_t zi_level; |
|
208 |
uint32_t zi_error; |
|
209 |
uint64_t zi_type; |
|
210 |
uint32_t zi_freq; |
|
9725
0bf7402e8022
6843014 ZFS B_FAILFAST handling is broken
Eric Schrock <Eric.Schrock@Sun.COM>
parents:
9643
diff
changeset
|
211 |
uint32_t zi_failfast; |
10594
986cb68d2347
6574286 removing a slog doesn't work
George Wilson <George.Wilson@Sun.COM>
parents:
10342
diff
changeset
|
212 |
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
|
213 |
uint32_t zi_iotype; |
10921
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10685
diff
changeset
|
214 |
int32_t zi_duration; |
8aac17999e4d
PSARC 2009/479 zpool recovery support
Tim Haley <Tim.Haley@Sun.COM>
parents:
10685
diff
changeset
|
215 |
uint64_t zi_timer; |
1544 | 216 |
} zinject_record_t; |
217 |
||
218 |
#define ZINJECT_NULL 0x1 |
|
219 |
#define ZINJECT_FLUSH_ARC 0x2 |
|
220 |
#define ZINJECT_UNLOAD_SPA 0x4 |
|
221 |
||
4543 | 222 |
typedef struct zfs_share { |
223 |
uint64_t z_exportdata; |
|
224 |
uint64_t z_sharedata; |
|
225 |
uint64_t z_sharetype; /* 0 = share, 1 = unshare */ |
|
226 |
uint64_t z_sharemax; /* max length of share string */ |
|
227 |
} zfs_share_t; |
|
228 |
||
5498
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
229 |
/* |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
230 |
* 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
|
231 |
* 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
|
232 |
* 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
|
233 |
* 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
|
234 |
*/ |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
235 |
typedef enum zfs_case { |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
236 |
ZFS_CASE_SENSITIVE, |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
237 |
ZFS_CASE_INSENSITIVE, |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
238 |
ZFS_CASE_MIXED |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
239 |
} zfs_case_t; |
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
240 |
|
789 | 241 |
typedef struct zfs_cmd { |
2467
9829873580a5
6443585 zpool create of poolname > 250 and < 256 characters panics in debug printout
ek110237
parents:
1544
diff
changeset
|
242 |
char zc_name[MAXPATHLEN]; |
3444
dc160a70a50d
6410433 'zpool status -v' would be more useful with filenames
ek110237
parents:
2926
diff
changeset
|
243 |
char zc_value[MAXPATHLEN * 2]; |
5367 | 244 |
char zc_string[MAXNAMELEN]; |
11007
216d8396182e
PSARC/2009/557 ZFS send dedup
Lori Alt <Lori.Alt@Sun.COM>
parents:
10921
diff
changeset
|
245 |
char zc_top_ds[MAXPATHLEN]; |
1544 | 246 |
uint64_t zc_guid; |
5094 | 247 |
uint64_t zc_nvlist_conf; /* really (char *) */ |
248 |
uint64_t zc_nvlist_conf_size; |
|
249 |
uint64_t zc_nvlist_src; /* really (char *) */ |
|
2676 | 250 |
uint64_t zc_nvlist_src_size; |
5094 | 251 |
uint64_t zc_nvlist_dst; /* really (char *) */ |
2676 | 252 |
uint64_t zc_nvlist_dst_size; |
789 | 253 |
uint64_t zc_cookie; |
254 |
uint64_t zc_objset_type; |
|
4543 | 255 |
uint64_t zc_perm_action; |
5094 | 256 |
uint64_t zc_history; /* really (char *) */ |
4543 | 257 |
uint64_t zc_history_len; |
2926 | 258 |
uint64_t zc_history_offset; |
3444
dc160a70a50d
6410433 'zpool status -v' would be more useful with filenames
ek110237
parents:
2926
diff
changeset
|
259 |
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
|
260 |
uint64_t zc_iflags; /* internal to zfs(7fs) */ |
4543 | 261 |
zfs_share_t zc_share; |
789 | 262 |
dmu_objset_stats_t zc_objset_stats; |
263 |
struct drr_begin zc_begin_record; |
|
1544 | 264 |
zinject_record_t zc_inject_record; |
10242
c40d075fbca6
PSARC/2009/297 zfs snapshot holds
Chris Kirby <chris.kirby@sun.com>
parents:
9725
diff
changeset
|
265 |
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
|
266 |
boolean_t zc_temphold; |
12527
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
267 |
uint64_t zc_action_handle; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
268 |
int zc_cleanup_fd; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
269 |
uint8_t zc_pad[4]; |
12798
f6c8601080b4
6938335 zfs send -R can still miss renamed snapshots
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12527
diff
changeset
|
270 |
uint64_t zc_sendobj; |
f6c8601080b4
6938335 zfs send -R can still miss renamed snapshots
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12527
diff
changeset
|
271 |
uint64_t zc_fromobj; |
f6c8601080b4
6938335 zfs send -R can still miss renamed snapshots
Chris Kirby <Chris.Kirby@oracle.com>
parents:
12527
diff
changeset
|
272 |
uint64_t zc_createtxg; |
789 | 273 |
} zfs_cmd_t; |
274 |
||
9396
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
275 |
typedef struct zfs_useracct { |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
276 |
char zu_domain[256]; |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
277 |
uid_t zu_rid; |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
278 |
uint32_t zu_pad; |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
279 |
uint64_t zu_space; |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
280 |
} zfs_useracct_t; |
f41cf682d0d3
PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
8934
diff
changeset
|
281 |
|
12527
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
282 |
#define ZFSDEV_MAX_MINOR (1 << 16) |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
283 |
#define ZFS_MIN_MINOR (ZFSDEV_MAX_MINOR + 1) |
849
8d799fd81a9b
6345023 /dev/zfs fails to open once ZFS module is unloaded
bonwick
parents:
789
diff
changeset
|
284 |
|
11422
42768837421d
PSARC/2009/511 zpool split
Mark J Musante <Mark.Musante@Sun.COM>
parents:
11381
diff
changeset
|
285 |
#define ZPOOL_EXPORT_AFTER_SPLIT 0x1 |
42768837421d
PSARC/2009/511 zpool split
Mark J Musante <Mark.Musante@Sun.COM>
parents:
11381
diff
changeset
|
286 |
|
789 | 287 |
#ifdef _KERNEL |
288 |
||
5331 | 289 |
typedef struct zfs_creat { |
5498
334b476844ca
6622831 normalization properties are not preserved by "zfs send"
timh
parents:
5367
diff
changeset
|
290 |
nvlist_t *zct_zplprops; |
5331 | 291 |
nvlist_t *zct_props; |
292 |
} zfs_creat_t; |
|
293 |
||
789 | 294 |
extern dev_info_t *zfs_dip; |
295 |
||
4543 | 296 |
extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr); |
297 |
extern int zfs_secpolicy_rename_perms(const char *from, |
|
298 |
const char *to, cred_t *cr); |
|
299 |
extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); |
|
789 | 300 |
extern int zfs_busy(void); |
11209
462283cb4096
6905188 panic: kernel heap corruption when doing "zfs rename -r"
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents:
11007
diff
changeset
|
301 |
extern int zfs_unmount_snap(const char *, void *); |
789 | 302 |
|
12527
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
303 |
/* |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
304 |
* ZFS minor numbers can refer to either a control device instance or |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
305 |
* a zvol. Depending on the value of zss_type, zss_data points to either |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
306 |
* a zvol_state_t or a zfs_onexit_t. |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
307 |
*/ |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
308 |
enum zfs_soft_state_type { |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
309 |
ZSST_ZVOL, |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
310 |
ZSST_CTLDEV |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
311 |
}; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
312 |
|
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
313 |
typedef struct zfs_soft_state { |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
314 |
enum zfs_soft_state_type zss_type; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
315 |
void *zss_data; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
316 |
} zfs_soft_state_t; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
317 |
|
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
318 |
extern void *zfsdev_get_soft_state(minor_t minor, |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
319 |
enum zfs_soft_state_type which); |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
320 |
extern minor_t zfsdev_minor_alloc(void); |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
321 |
|
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
322 |
extern void *zfsdev_state; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
323 |
extern kmutex_t zfsdev_state_lock; |
693dd2cad55f
6884007 zfs_send() can leave temporary holds around
Chris Kirby <Chris.Kirby@oracle.com>
parents:
11935
diff
changeset
|
324 |
|
789 | 325 |
#endif /* _KERNEL */ |
326 |
||
327 |
#ifdef __cplusplus |
|
328 |
} |
|
329 |
#endif |
|
330 |
||
331 |
#endif /* _SYS_ZFS_IOCTL_H */ |