Print this page
NEX-14164 'modified' property doesn't work for autosnapshots
Reviewed by: Alex Deiter <alex.deiter@nexenta.com>
Reviewed by: Alexey Komarov <alexey.komarov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-9406 Add a property to show that a dataset has been modified since a snapshot
Reviewed by: Alexey Komarov <alexey.komarov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-9436 Rate limiting controls (was QoS) per ZFS dataset, updates from demo
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
NEX-8852 Quality-of-Service (QoS) controls per NFS share
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-6269 Unwanted inheritance of the sharesmb ZFS property
Reviewed by: Yuri Pankov <yuri.pankov@nexeneta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexeneta.com>
NEX-5795 Rename 'wrc' as 'wbc' in the source and in the tech docs
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
NEX-5318 Cleanup specialclass property (obsolete, not used) and fix related meta-to-special case
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
NEX-5058 WBC: Race between the purging of window and opening new one
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
NEX-2830 ZFS smart compression
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-4934 Add capability to remove special vdev
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
2605 want to resume interrupted zfs send
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R (fix studio build)
4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@damore.org>
NEX-4476 WRC: Allow to use write back cache per tree of datasets
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
Revert "NEX-4476 WRC: Allow to use write back cache per tree of datasets"
This reverts commit fe97b74444278a6f36fec93179133641296312da.
NEX-4476 WRC: Allow to use write back cache per tree of datasets
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Alex Aizman <alex.aizman@nexenta.com>
NEX-4044 remove sha1crc32 in preparation with upstream merge of edon-r and skien
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Alek Pinchuk <alek@nexenta.com>
Conflicts:
usr/src/uts/common/fs/zfs/sys/zio_checksum.h
NEX-3669 Faults for fans that don't exist
Reviewed by: Jeffry Molanus <jeffry.molanus@nexenta.com>
NEX-3891 Hide the snapshots that belong to in-kernel autosnap-service
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Alek Pinchuk <alek@nexenta.com>
NEX-3558 KRRP Integration
OS-80 support for vdev and CoS properties for the new I/O scheduler
OS-95 lint warning introduced by OS-61
Make special vdev subtree topology the same as regular vdev subtree to simplify testcase setup
Fixup merge issues
Issue #7: add cacheability to the properties
Contributors: Boris Protopopov
Issues #7: Reconsile L2ARC and "special" use by datasets
Support for secondarycache=data option
Align mutex tables in arc.c and dbuf.c to 64 bytes (cache line), place each kmutex_t on cache line by itself to avoid false sharing
Fixup merge results
re #12585 rb4049 ZFS++ work port - refactoring to improve separation of open/closed code, bug fixes, performance improvements - open code
Bug 11205: add missing libzfs_closed_stubs.c to fix opensource-only build.
ZFS plus work: special vdevs, cos, cos/vdev properties
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/common/zfs/zfs_prop.c
+++ new/usr/src/common/zfs/zfs_prop.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
|
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
24 24 * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
25 25 * Copyright (c) 2014 Integros [integros.com]
26 + * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
26 27 * Copyright 2016, Joyent, Inc.
27 28 */
28 29
29 30 /* Portions Copyright 2010 Robert Milkowski */
30 31
31 32 #include <sys/zio.h>
32 33 #include <sys/spa.h>
34 +#include <sys/special.h>
33 35 #include <sys/u8_textprep.h>
34 36 #include <sys/zfs_acl.h>
35 37 #include <sys/zfs_ioctl.h>
36 38 #include <sys/zfs_znode.h>
37 39
38 40 #include "zfs_prop.h"
39 41 #include "zfs_deleg.h"
40 42
41 43 #if defined(_KERNEL)
42 44 #include <sys/systm.h>
43 45 #else
44 46 #include <stdlib.h>
45 47 #include <string.h>
46 48 #include <ctype.h>
47 49 #endif
48 50
49 51 static zprop_desc_t zfs_prop_table[ZFS_NUM_PROPS];
50 52
51 53 /* Note this is indexed by zfs_userquota_prop_t, keep the order the same */
52 54 const char *zfs_userquota_prop_prefixes[] = {
53 55 "userused@",
54 56 "userquota@",
55 57 "groupused@",
56 58 "groupquota@"
57 59 };
58 60
59 61 zprop_desc_t *
60 62 zfs_prop_get_table(void)
61 63 {
62 64 return (zfs_prop_table);
63 65 }
64 66
65 67 void
66 68 zfs_prop_init(void)
67 69 {
68 70 static zprop_index_t checksum_table[] = {
69 71 { "on", ZIO_CHECKSUM_ON },
70 72 { "off", ZIO_CHECKSUM_OFF },
71 73 { "fletcher2", ZIO_CHECKSUM_FLETCHER_2 },
72 74 { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 },
73 75 { "sha256", ZIO_CHECKSUM_SHA256 },
74 76 { "noparity", ZIO_CHECKSUM_NOPARITY },
75 77 { "sha512", ZIO_CHECKSUM_SHA512 },
76 78 { "skein", ZIO_CHECKSUM_SKEIN },
77 79 { "edonr", ZIO_CHECKSUM_EDONR },
78 80 { NULL }
79 81 };
80 82
81 83 static zprop_index_t dedup_table[] = {
82 84 { "on", ZIO_CHECKSUM_ON },
83 85 { "off", ZIO_CHECKSUM_OFF },
84 86 { "verify", ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
85 87 { "sha256", ZIO_CHECKSUM_SHA256 },
86 88 { "sha256,verify",
87 89 ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY },
88 90 { "sha512", ZIO_CHECKSUM_SHA512 },
89 91 { "sha512,verify",
90 92 ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY },
91 93 { "skein", ZIO_CHECKSUM_SKEIN },
92 94 { "skein,verify",
93 95 ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY },
94 96 { "edonr,verify",
95 97 ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY },
96 98 { NULL }
97 99 };
98 100
99 101 static zprop_index_t compress_table[] = {
100 102 { "on", ZIO_COMPRESS_ON },
101 103 { "off", ZIO_COMPRESS_OFF },
102 104 { "lzjb", ZIO_COMPRESS_LZJB },
103 105 { "gzip", ZIO_COMPRESS_GZIP_6 }, /* gzip default */
104 106 { "gzip-1", ZIO_COMPRESS_GZIP_1 },
105 107 { "gzip-2", ZIO_COMPRESS_GZIP_2 },
106 108 { "gzip-3", ZIO_COMPRESS_GZIP_3 },
107 109 { "gzip-4", ZIO_COMPRESS_GZIP_4 },
108 110 { "gzip-5", ZIO_COMPRESS_GZIP_5 },
109 111 { "gzip-6", ZIO_COMPRESS_GZIP_6 },
110 112 { "gzip-7", ZIO_COMPRESS_GZIP_7 },
111 113 { "gzip-8", ZIO_COMPRESS_GZIP_8 },
112 114 { "gzip-9", ZIO_COMPRESS_GZIP_9 },
113 115 { "zle", ZIO_COMPRESS_ZLE },
114 116 { "lz4", ZIO_COMPRESS_LZ4 },
115 117 { NULL }
116 118 };
117 119
118 120 static zprop_index_t snapdir_table[] = {
119 121 { "hidden", ZFS_SNAPDIR_HIDDEN },
120 122 { "visible", ZFS_SNAPDIR_VISIBLE },
121 123 { NULL }
122 124 };
123 125
124 126 static zprop_index_t acl_mode_table[] = {
125 127 { "discard", ZFS_ACL_DISCARD },
126 128 { "groupmask", ZFS_ACL_GROUPMASK },
127 129 { "passthrough", ZFS_ACL_PASSTHROUGH },
128 130 { "restricted", ZFS_ACL_RESTRICTED },
129 131 { NULL }
130 132 };
131 133
132 134 static zprop_index_t acl_inherit_table[] = {
133 135 { "discard", ZFS_ACL_DISCARD },
134 136 { "noallow", ZFS_ACL_NOALLOW },
135 137 { "restricted", ZFS_ACL_RESTRICTED },
136 138 { "passthrough", ZFS_ACL_PASSTHROUGH },
137 139 { "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */
138 140 { "passthrough-x", ZFS_ACL_PASSTHROUGH_X },
139 141 { NULL }
140 142 };
141 143
142 144 static zprop_index_t case_table[] = {
143 145 { "sensitive", ZFS_CASE_SENSITIVE },
144 146 { "insensitive", ZFS_CASE_INSENSITIVE },
145 147 { "mixed", ZFS_CASE_MIXED },
146 148 { NULL }
147 149 };
148 150
149 151 static zprop_index_t copies_table[] = {
150 152 { "1", 1 },
151 153 { "2", 2 },
152 154 { "3", 3 },
153 155 { NULL }
154 156 };
155 157
156 158 /*
157 159 * Use the unique flags we have to send to u8_strcmp() and/or
158 160 * u8_textprep() to represent the various normalization property
159 161 * values.
160 162 */
161 163 static zprop_index_t normalize_table[] = {
162 164 { "none", 0 },
163 165 { "formD", U8_TEXTPREP_NFD },
164 166 { "formKC", U8_TEXTPREP_NFKC },
165 167 { "formC", U8_TEXTPREP_NFC },
166 168 { "formKD", U8_TEXTPREP_NFKD },
167 169 { NULL }
168 170 };
169 171
170 172 static zprop_index_t version_table[] = {
171 173 { "1", 1 },
172 174 { "2", 2 },
173 175 { "3", 3 },
174 176 { "4", 4 },
175 177 { "5", 5 },
176 178 { "current", ZPL_VERSION },
177 179 { NULL }
178 180 };
179 181
180 182 static zprop_index_t boolean_table[] = {
181 183 { "off", 0 },
|
↓ open down ↓ |
139 lines elided |
↑ open up ↑ |
182 184 { "on", 1 },
183 185 { NULL }
184 186 };
185 187
186 188 static zprop_index_t logbias_table[] = {
187 189 { "latency", ZFS_LOGBIAS_LATENCY },
188 190 { "throughput", ZFS_LOGBIAS_THROUGHPUT },
189 191 { NULL }
190 192 };
191 193
194 + static zprop_index_t wbc_modes_table[] = {
195 + { "off", ZFS_WBC_MODE_OFF },
196 + { "on", ZFS_WBC_MODE_ON },
197 + { NULL }
198 + };
199 +
192 200 static zprop_index_t canmount_table[] = {
193 201 { "off", ZFS_CANMOUNT_OFF },
194 202 { "on", ZFS_CANMOUNT_ON },
195 203 { "noauto", ZFS_CANMOUNT_NOAUTO },
196 204 { NULL }
197 205 };
198 206
199 - static zprop_index_t cache_table[] = {
207 + static zprop_index_t primary_cache_table[] = {
200 208 { "none", ZFS_CACHE_NONE },
201 209 { "metadata", ZFS_CACHE_METADATA },
202 210 { "all", ZFS_CACHE_ALL },
203 211 { NULL }
204 212 };
205 213
214 + static zprop_index_t secondary_cache_table[] = {
215 + { "none", ZFS_CACHE_NONE },
216 + { "metadata", ZFS_CACHE_METADATA },
217 + { "all", ZFS_CACHE_ALL },
218 + { "data", ZFS_CACHE_DATA },
219 + { NULL }
220 + };
221 +
206 222 static zprop_index_t sync_table[] = {
207 223 { "standard", ZFS_SYNC_STANDARD },
208 224 { "always", ZFS_SYNC_ALWAYS },
209 225 { "disabled", ZFS_SYNC_DISABLED },
210 226 { NULL }
211 227 };
212 228
213 229 static zprop_index_t redundant_metadata_table[] = {
214 230 { "all", ZFS_REDUNDANT_METADATA_ALL },
215 231 { "most", ZFS_REDUNDANT_METADATA_MOST },
216 232 { NULL }
217 233 };
218 234
235 + static zprop_index_t meta_placement_table[] = {
236 + { "off", META_PLACEMENT_OFF},
237 + { "on", META_PLACEMENT_ON},
238 + { "dual", META_PLACEMENT_DUAL},
239 + { NULL }
240 + };
241 +
219 242 /* inherit index properties */
220 243 zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
221 244 ZFS_REDUNDANT_METADATA_ALL,
222 245 PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
223 246 "all | most", "REDUND_MD",
224 247 redundant_metadata_table);
225 248 zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
226 249 PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
227 250 "standard | always | disabled", "SYNC",
228 251 sync_table);
229 252 zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
230 253 ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
231 254 ZFS_TYPE_VOLUME,
232 255 "on | off | fletcher2 | fletcher4 | sha256 | sha512 | "
233 256 "skein | edonr", "CHECKSUM", checksum_table);
234 257 zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
235 258 PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
236 259 "on | off | verify | sha256[,verify], sha512[,verify], "
237 260 "skein[,verify], edonr,verify", "DEDUP", dedup_table);
238 261 zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
239 262 ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
240 263 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
241 264 "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
242 265 "COMPRESS", compress_table);
243 266 zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
244 267 PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
245 268 "hidden | visible", "SNAPDIR", snapdir_table);
246 269 zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
247 270 PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
248 271 "discard | groupmask | passthrough | restricted", "ACLMODE",
|
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
249 272 acl_mode_table);
250 273 zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
251 274 ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
252 275 "discard | noallow | restricted | passthrough | passthrough-x",
253 276 "ACLINHERIT", acl_inherit_table);
254 277 zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
255 278 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
256 279 "1 | 2 | 3", "COPIES", copies_table);
257 280 zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",
258 281 ZFS_CACHE_ALL, PROP_INHERIT,
259 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
260 - "all | none | metadata", "PRIMARYCACHE", cache_table);
282 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP |
283 + ZFS_TYPE_VOLUME,
284 + "all | none | metadata", "PRIMARYCACHE", primary_cache_table);
261 285 zprop_register_index(ZFS_PROP_SECONDARYCACHE, "secondarycache",
262 286 ZFS_CACHE_ALL, PROP_INHERIT,
263 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
264 - "all | none | metadata", "SECONDARYCACHE", cache_table);
287 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP |
288 + ZFS_TYPE_VOLUME,
289 + "all | none | metadata | data", "SECONDARYCACHE",
290 + secondary_cache_table);
265 291 zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY,
266 292 PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
267 293 "latency | throughput", "LOGBIAS", logbias_table);
294 + zprop_register_index(ZFS_PROP_WBC_MODE, "wbc_mode", ZFS_WBC_MODE_OFF,
295 + PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
296 + "off | on", "WBC_MODE", wbc_modes_table);
297 + zprop_register_index(ZFS_PROP_ZPL_META_TO_METADEV,
298 + "zpl_meta_to_metadev", META_PLACEMENT_OFF, PROP_INHERIT,
299 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP |
300 + ZFS_TYPE_VOLUME,
301 + "on | dual | off", "ZPLMETA_TO_MD", meta_placement_table);
268 302
269 303 /* inherit index (boolean) properties */
270 304 zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT,
271 305 ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table);
272 306 zprop_register_index(ZFS_PROP_DEVICES, "devices", 1, PROP_INHERIT,
273 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "DEVICES",
274 - boolean_table);
307 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
308 + "on | off", "DEVICES", boolean_table);
275 309 zprop_register_index(ZFS_PROP_EXEC, "exec", 1, PROP_INHERIT,
276 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "EXEC",
277 - boolean_table);
310 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
311 + "on | off", "EXEC", boolean_table);
278 312 zprop_register_index(ZFS_PROP_SETUID, "setuid", 1, PROP_INHERIT,
279 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "SETUID",
280 - boolean_table);
313 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
314 + "on | off", "SETUID", boolean_table);
281 315 zprop_register_index(ZFS_PROP_READONLY, "readonly", 0, PROP_INHERIT,
282 316 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off", "RDONLY",
283 317 boolean_table);
284 318 zprop_register_index(ZFS_PROP_ZONED, "zoned", 0, PROP_INHERIT,
285 319 ZFS_TYPE_FILESYSTEM, "on | off", "ZONED", boolean_table);
286 320 zprop_register_index(ZFS_PROP_XATTR, "xattr", 1, PROP_INHERIT,
287 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "XATTR",
288 - boolean_table);
321 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
322 + "on | off", "XATTR", boolean_table);
289 323 zprop_register_index(ZFS_PROP_VSCAN, "vscan", 0, PROP_INHERIT,
290 324 ZFS_TYPE_FILESYSTEM, "on | off", "VSCAN",
291 325 boolean_table);
292 326 zprop_register_index(ZFS_PROP_NBMAND, "nbmand", 0, PROP_INHERIT,
293 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "NBMAND",
327 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
328 + "on | off", "NBMAND", boolean_table);
329 + zprop_register_index(ZFS_PROP_SMARTCOMPRESSION, "smartcompression", 1,
330 + PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off", "SMARTCOMPRESSION",
294 331 boolean_table);
295 332
296 333 /* default index properties */
297 334 zprop_register_index(ZFS_PROP_VERSION, "version", 0, PROP_DEFAULT,
298 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
335 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
299 336 "1 | 2 | 3 | 4 | 5 | current", "VERSION", version_table);
300 337 zprop_register_index(ZFS_PROP_CANMOUNT, "canmount", ZFS_CANMOUNT_ON,
301 338 PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, "on | off | noauto",
302 339 "CANMOUNT", canmount_table);
303 340
304 341 /* readonly index (boolean) properties */
305 342 zprop_register_index(ZFS_PROP_MOUNTED, "mounted", 0, PROP_READONLY,
306 343 ZFS_TYPE_FILESYSTEM, "yes | no", "MOUNTED", boolean_table);
307 344 zprop_register_index(ZFS_PROP_DEFER_DESTROY, "defer_destroy", 0,
308 - PROP_READONLY, ZFS_TYPE_SNAPSHOT, "yes | no", "DEFER_DESTROY",
309 - boolean_table);
345 + PROP_READONLY, ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
346 + "yes | no", "DEFER_DESTROY", boolean_table);
310 347
311 348 /* set once index properties */
312 349 zprop_register_index(ZFS_PROP_NORMALIZE, "normalization", 0,
313 - PROP_ONETIME, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
350 + PROP_ONETIME, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT |
351 + ZFS_TYPE_AUTOSNAP,
314 352 "none | formC | formD | formKC | formKD", "NORMALIZATION",
315 353 normalize_table);
316 354 zprop_register_index(ZFS_PROP_CASE, "casesensitivity",
317 355 ZFS_CASE_SENSITIVE, PROP_ONETIME, ZFS_TYPE_FILESYSTEM |
318 - ZFS_TYPE_SNAPSHOT,
356 + ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
319 357 "sensitive | insensitive | mixed", "CASE", case_table);
320 358
321 359 /* set once index (boolean) properties */
322 360 zprop_register_index(ZFS_PROP_UTF8ONLY, "utf8only", 0, PROP_ONETIME,
323 - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
361 + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP,
324 362 "on | off", "UTF8ONLY", boolean_table);
325 363
326 364 /* string properties */
327 365 zprop_register_string(ZFS_PROP_ORIGIN, "origin", NULL, PROP_READONLY,
328 366 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<snapshot>", "ORIGIN");
329 367 zprop_register_string(ZFS_PROP_CLONES, "clones", NULL, PROP_READONLY,
330 - ZFS_TYPE_SNAPSHOT, "<dataset>[,...]", "CLONES");
368 + ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP, "<dataset>[,...]", "CLONES");
331 369 zprop_register_string(ZFS_PROP_MOUNTPOINT, "mountpoint", "/",
332 370 PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "<path> | legacy | none",
333 371 "MOUNTPOINT");
334 372 zprop_register_string(ZFS_PROP_SHARENFS, "sharenfs", "off",
335 373 PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | share(1M) options",
336 374 "SHARENFS");
337 375 zprop_register_string(ZFS_PROP_TYPE, "type", NULL, PROP_READONLY,
338 376 ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK,
339 - "filesystem | volume | snapshot | bookmark", "TYPE");
377 + "filesystem | volume | snapshot | autosnap | bookmark", "TYPE");
340 378 zprop_register_string(ZFS_PROP_SHARESMB, "sharesmb", "off",
341 - PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
379 + PROP_DEFAULT, ZFS_TYPE_FILESYSTEM,
342 380 "on | off | sharemgr(1M) options", "SHARESMB");
343 381 zprop_register_string(ZFS_PROP_MLSLABEL, "mlslabel",
344 382 ZFS_MLSLABEL_DEFAULT, PROP_INHERIT, ZFS_TYPE_DATASET,
345 383 "<sensitivity label>", "MLSLABEL");
346 384 zprop_register_string(ZFS_PROP_RECEIVE_RESUME_TOKEN,
347 385 "receive_resume_token",
348 386 NULL, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
349 387 "<string token>", "RESUMETOK");
350 388
351 389 /* readonly number properties */
352 390 zprop_register_number(ZFS_PROP_USED, "used", 0, PROP_READONLY,
353 391 ZFS_TYPE_DATASET, "<size>", "USED");
354 392 zprop_register_number(ZFS_PROP_AVAILABLE, "available", 0, PROP_READONLY,
355 393 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "AVAIL");
356 394 zprop_register_number(ZFS_PROP_REFERENCED, "referenced", 0,
357 395 PROP_READONLY, ZFS_TYPE_DATASET, "<size>", "REFER");
358 396 zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0,
359 397 PROP_READONLY, ZFS_TYPE_DATASET,
360 398 "<1.00x or higher if compressed>", "RATIO");
361 399 zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0,
362 400 PROP_READONLY, ZFS_TYPE_DATASET,
363 401 "<1.00x or higher if compressed>", "REFRATIO");
364 402 zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize",
365 403 ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME,
366 404 ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK");
367 405 zprop_register_number(ZFS_PROP_USEDSNAP, "usedbysnapshots", 0,
368 406 PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
369 407 "USEDSNAP");
|
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
370 408 zprop_register_number(ZFS_PROP_USEDDS, "usedbydataset", 0,
371 409 PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
372 410 "USEDDS");
373 411 zprop_register_number(ZFS_PROP_USEDCHILD, "usedbychildren", 0,
374 412 PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
375 413 "USEDCHILD");
376 414 zprop_register_number(ZFS_PROP_USEDREFRESERV, "usedbyrefreservation", 0,
377 415 PROP_READONLY,
378 416 ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV");
379 417 zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY,
380 - ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS");
418 + ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP, "<count>", "USERREFS");
381 419 zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY,
382 420 ZFS_TYPE_DATASET, "<size>", "WRITTEN");
383 421 zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0,
384 422 PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
385 423 "LUSED");
386 424 zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced",
387 425 0, PROP_READONLY, ZFS_TYPE_DATASET, "<size>", "LREFER");
388 426 zprop_register_number(ZFS_PROP_FILESYSTEM_COUNT, "filesystem_count",
389 427 UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM,
390 428 "<count>", "FSCOUNT");
391 429 zprop_register_number(ZFS_PROP_SNAPSHOT_COUNT, "snapshot_count",
392 430 UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
393 431 "<count>", "SSCOUNT");
394 432
395 433 /* default number properties */
396 434 zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
397 435 ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA");
398 436 zprop_register_number(ZFS_PROP_RESERVATION, "reservation", 0,
399 437 PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
400 438 "<size> | none", "RESERV");
401 439 zprop_register_number(ZFS_PROP_VOLSIZE, "volsize", 0, PROP_DEFAULT,
402 440 ZFS_TYPE_VOLUME, "<size>", "VOLSIZE");
403 441 zprop_register_number(ZFS_PROP_REFQUOTA, "refquota", 0, PROP_DEFAULT,
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
404 442 ZFS_TYPE_FILESYSTEM, "<size> | none", "REFQUOTA");
405 443 zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0,
406 444 PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
407 445 "<size> | none", "REFRESERV");
408 446 zprop_register_number(ZFS_PROP_FILESYSTEM_LIMIT, "filesystem_limit",
409 447 UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM,
410 448 "<count> | none", "FSLIMIT");
411 449 zprop_register_number(ZFS_PROP_SNAPSHOT_LIMIT, "snapshot_limit",
412 450 UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
413 451 "<count> | none", "SSLIMIT");
452 + zprop_register_number(ZFS_PROP_RATE_LIMIT, "rate_limit",
453 + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM,
454 + "<count> | none", "RATELIMIT");
414 455
415 456 /* inherit number properties */
416 457 zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize",
417 458 SPA_OLD_MAXBLOCKSIZE, PROP_INHERIT,
418 459 ZFS_TYPE_FILESYSTEM, "512 to 1M, power of 2", "RECSIZE");
419 460
420 461 /* hidden properties */
421 462 zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER,
422 463 PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "CREATETXG");
423 - zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER,
424 - PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG");
425 464 zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER,
426 465 PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES");
427 466 zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING,
428 467 PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "NAME");
429 468 zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions",
430 469 PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS");
431 470 zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu",
432 471 PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME,
433 472 "STMF_SBD_LU");
434 473 zprop_register_hidden(ZFS_PROP_GUID, "guid", PROP_TYPE_NUMBER,
435 474 PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "GUID");
436 475 zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting",
|
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
437 476 PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET,
438 477 "USERACCOUNTING");
439 478 zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER,
440 479 PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE");
441 480 zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER,
442 481 PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
443 482 zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent",
444 483 PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT");
445 484 zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING,
446 485 PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP");
486 + zprop_register_hidden(ZFS_PROP_LSTXG, "lstxg", PROP_TYPE_NUMBER,
487 + PROP_READONLY, ZFS_TYPE_DATASET, "LSTXG");
488 + zprop_register_index_hidden(ZFS_PROP_MODIFIED, "modified", 0,
489 + PROP_READONLY, ZFS_TYPE_SNAPSHOT | ZFS_TYPE_AUTOSNAP, "yes | no",
490 + "MODIFIED", boolean_table);
447 491
448 492 /* oddball properties */
449 493 zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0,
450 494 NULL, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK,
451 495 "<date>", "CREATION", B_FALSE, B_TRUE, NULL);
452 496 }
453 497
454 498 boolean_t
455 499 zfs_prop_delegatable(zfs_prop_t prop)
456 500 {
457 501 zprop_desc_t *pd = &zfs_prop_table[prop];
458 502
459 503 /* The mlslabel property is never delegatable. */
460 504 if (prop == ZFS_PROP_MLSLABEL)
461 505 return (B_FALSE);
462 506
463 507 return (pd->pd_attr != PROP_READONLY);
464 508 }
465 509
466 510 /*
467 511 * Given a zfs dataset property name, returns the corresponding property ID.
468 512 */
469 513 zfs_prop_t
470 514 zfs_name_to_prop(const char *propname)
471 515 {
472 516 return (zprop_name_to_prop(propname, ZFS_TYPE_DATASET));
473 517 }
474 518
475 519 /*
476 520 * For user property names, we allow all lowercase alphanumeric characters, plus
477 521 * a few useful punctuation characters.
478 522 */
479 523 static int
480 524 valid_char(char c)
481 525 {
482 526 return ((c >= 'a' && c <= 'z') ||
483 527 (c >= '0' && c <= '9') ||
484 528 c == '-' || c == '_' || c == '.' || c == ':');
485 529 }
486 530
487 531 /*
488 532 * Returns true if this is a valid user-defined property (one with a ':').
489 533 */
490 534 boolean_t
491 535 zfs_prop_user(const char *name)
492 536 {
493 537 int i;
494 538 char c;
495 539 boolean_t foundsep = B_FALSE;
496 540
497 541 for (i = 0; i < strlen(name); i++) {
498 542 c = name[i];
499 543 if (!valid_char(c))
500 544 return (B_FALSE);
501 545 if (c == ':')
502 546 foundsep = B_TRUE;
503 547 }
504 548
505 549 if (!foundsep)
506 550 return (B_FALSE);
507 551
508 552 return (B_TRUE);
509 553 }
510 554
511 555 /*
512 556 * Returns true if this is a valid userspace-type property (one with a '@').
513 557 * Note that after the @, any character is valid (eg, another @, for SID
514 558 * user@domain).
515 559 */
516 560 boolean_t
517 561 zfs_prop_userquota(const char *name)
518 562 {
519 563 zfs_userquota_prop_t prop;
520 564
521 565 for (prop = 0; prop < ZFS_NUM_USERQUOTA_PROPS; prop++) {
522 566 if (strncmp(name, zfs_userquota_prop_prefixes[prop],
523 567 strlen(zfs_userquota_prop_prefixes[prop])) == 0) {
524 568 return (B_TRUE);
525 569 }
526 570 }
527 571
528 572 return (B_FALSE);
529 573 }
530 574
531 575 /*
532 576 * Returns true if this is a valid written@ property.
533 577 * Note that after the @, any character is valid (eg, another @, for
534 578 * written@pool/fs@origin).
535 579 */
536 580 boolean_t
537 581 zfs_prop_written(const char *name)
538 582 {
539 583 static const char *prefix = "written@";
540 584 return (strncmp(name, prefix, strlen(prefix)) == 0);
541 585 }
542 586
543 587 /*
544 588 * Tables of index types, plus functions to convert between the user view
545 589 * (strings) and internal representation (uint64_t).
546 590 */
547 591 int
548 592 zfs_prop_string_to_index(zfs_prop_t prop, const char *string, uint64_t *index)
549 593 {
550 594 return (zprop_string_to_index(prop, string, index, ZFS_TYPE_DATASET));
551 595 }
552 596
553 597 int
554 598 zfs_prop_index_to_string(zfs_prop_t prop, uint64_t index, const char **string)
555 599 {
556 600 return (zprop_index_to_string(prop, index, string, ZFS_TYPE_DATASET));
557 601 }
558 602
559 603 uint64_t
560 604 zfs_prop_random_value(zfs_prop_t prop, uint64_t seed)
561 605 {
562 606 return (zprop_random_value(prop, seed, ZFS_TYPE_DATASET));
563 607 }
564 608
565 609 /*
566 610 * Returns TRUE if the property applies to any of the given dataset types.
567 611 */
568 612 boolean_t
569 613 zfs_prop_valid_for_type(int prop, zfs_type_t types)
570 614 {
571 615 return (zprop_valid_for_type(prop, types));
572 616 }
573 617
574 618 zprop_type_t
575 619 zfs_prop_get_type(zfs_prop_t prop)
576 620 {
577 621 return (zfs_prop_table[prop].pd_proptype);
578 622 }
579 623
580 624 /*
581 625 * Returns TRUE if the property is readonly.
582 626 */
583 627 boolean_t
584 628 zfs_prop_readonly(zfs_prop_t prop)
585 629 {
586 630 return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
587 631 zfs_prop_table[prop].pd_attr == PROP_ONETIME);
588 632 }
589 633
590 634 /*
591 635 * Returns TRUE if the property is visible (not hidden).
592 636 */
593 637 boolean_t
594 638 zfs_prop_visible(zfs_prop_t prop)
595 639 {
596 640 return (zfs_prop_table[prop].pd_visible);
597 641 }
598 642
599 643 /*
600 644 * Returns TRUE if the property is only allowed to be set once.
601 645 */
602 646 boolean_t
603 647 zfs_prop_setonce(zfs_prop_t prop)
604 648 {
605 649 return (zfs_prop_table[prop].pd_attr == PROP_ONETIME);
606 650 }
607 651
608 652 const char *
609 653 zfs_prop_default_string(zfs_prop_t prop)
610 654 {
611 655 return (zfs_prop_table[prop].pd_strdefault);
612 656 }
613 657
614 658 uint64_t
615 659 zfs_prop_default_numeric(zfs_prop_t prop)
616 660 {
617 661 return (zfs_prop_table[prop].pd_numdefault);
618 662 }
619 663
620 664 /*
621 665 * Given a dataset property ID, returns the corresponding name.
622 666 * Assuming the zfs dataset property ID is valid.
623 667 */
624 668 const char *
625 669 zfs_prop_to_name(zfs_prop_t prop)
626 670 {
627 671 return (zfs_prop_table[prop].pd_name);
628 672 }
629 673
630 674 /*
631 675 * Returns TRUE if the property is inheritable.
632 676 */
633 677 boolean_t
634 678 zfs_prop_inheritable(zfs_prop_t prop)
635 679 {
636 680 return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
637 681 zfs_prop_table[prop].pd_attr == PROP_ONETIME);
638 682 }
639 683
640 684 #ifndef _KERNEL
641 685
642 686 /*
643 687 * Returns a string describing the set of acceptable values for the given
644 688 * zfs property, or NULL if it cannot be set.
645 689 */
646 690 const char *
647 691 zfs_prop_values(zfs_prop_t prop)
648 692 {
649 693 return (zfs_prop_table[prop].pd_values);
650 694 }
651 695
652 696 /*
653 697 * Returns TRUE if this property is a string type. Note that index types
654 698 * (compression, checksum) are treated as strings in userland, even though they
655 699 * are stored numerically on disk.
656 700 */
657 701 int
658 702 zfs_prop_is_string(zfs_prop_t prop)
659 703 {
660 704 return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
661 705 zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
662 706 }
663 707
664 708 /*
665 709 * Returns the column header for the given property. Used only in
666 710 * 'zfs list -o', but centralized here with the other property information.
667 711 */
668 712 const char *
669 713 zfs_prop_column_name(zfs_prop_t prop)
670 714 {
671 715 return (zfs_prop_table[prop].pd_colname);
672 716 }
673 717
674 718 /*
675 719 * Returns whether the given property should be displayed right-justified for
676 720 * 'zfs list'.
677 721 */
678 722 boolean_t
679 723 zfs_prop_align_right(zfs_prop_t prop)
680 724 {
681 725 return (zfs_prop_table[prop].pd_rightalign);
682 726 }
683 727
684 728 #endif
|
↓ open down ↓ |
228 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX