zfs.h (201143) | zfs.h (209962) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 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/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. 24 */ 25 26#ifndef _SYS_FS_ZFS_H 27#define _SYS_FS_ZFS_H 28 29#include <sys/types.h> 30#include <sys/ioccom.h> --- 73 unchanged lines hidden (view full) --- 104 ZFS_PROP_REFRESERVATION, 105 ZFS_PROP_GUID, 106 ZFS_PROP_PRIMARYCACHE, 107 ZFS_PROP_SECONDARYCACHE, 108 ZFS_PROP_USEDSNAP, 109 ZFS_PROP_USEDDS, 110 ZFS_PROP_USEDCHILD, 111 ZFS_PROP_USEDREFRESERV, | 23 * Use is subject to license terms. 24 */ 25 26#ifndef _SYS_FS_ZFS_H 27#define _SYS_FS_ZFS_H 28 29#include <sys/types.h> 30#include <sys/ioccom.h> --- 73 unchanged lines hidden (view full) --- 104 ZFS_PROP_REFRESERVATION, 105 ZFS_PROP_GUID, 106 ZFS_PROP_PRIMARYCACHE, 107 ZFS_PROP_SECONDARYCACHE, 108 ZFS_PROP_USEDSNAP, 109 ZFS_PROP_USEDDS, 110 ZFS_PROP_USEDCHILD, 111 ZFS_PROP_USEDREFRESERV, |
112 ZFS_PROP_USERACCOUNTING, /* not exposed to the user */ |
|
112 ZFS_NUM_PROPS 113} zfs_prop_t; 114 | 113 ZFS_NUM_PROPS 114} zfs_prop_t; 115 |
116typedef enum { 117 ZFS_PROP_USERUSED, 118 ZFS_PROP_USERQUOTA, 119 ZFS_PROP_GROUPUSED, 120 ZFS_PROP_GROUPQUOTA, 121 ZFS_NUM_USERQUOTA_PROPS 122} zfs_userquota_prop_t; 123 124extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS]; 125 |
|
115/* 116 * Pool properties are identified by these constants and must be added to the 117 * end of this list to ensure that external consumers are not affected 118 * by the change. If you make any changes to this list, be sure to update 119 * the property table in usr/src/common/zfs/zpool_prop.c. 120 */ 121typedef enum { 122 ZPOOL_PROP_NAME, --- 45 unchanged lines hidden (view full) --- 168const char *zfs_prop_default_string(zfs_prop_t); 169uint64_t zfs_prop_default_numeric(zfs_prop_t); 170boolean_t zfs_prop_readonly(zfs_prop_t); 171boolean_t zfs_prop_inheritable(zfs_prop_t); 172boolean_t zfs_prop_setonce(zfs_prop_t); 173const char *zfs_prop_to_name(zfs_prop_t); 174zfs_prop_t zfs_name_to_prop(const char *); 175boolean_t zfs_prop_user(const char *); | 126/* 127 * Pool properties are identified by these constants and must be added to the 128 * end of this list to ensure that external consumers are not affected 129 * by the change. If you make any changes to this list, be sure to update 130 * the property table in usr/src/common/zfs/zpool_prop.c. 131 */ 132typedef enum { 133 ZPOOL_PROP_NAME, --- 45 unchanged lines hidden (view full) --- 179const char *zfs_prop_default_string(zfs_prop_t); 180uint64_t zfs_prop_default_numeric(zfs_prop_t); 181boolean_t zfs_prop_readonly(zfs_prop_t); 182boolean_t zfs_prop_inheritable(zfs_prop_t); 183boolean_t zfs_prop_setonce(zfs_prop_t); 184const char *zfs_prop_to_name(zfs_prop_t); 185zfs_prop_t zfs_name_to_prop(const char *); 186boolean_t zfs_prop_user(const char *); |
187boolean_t zfs_prop_userquota(const char *name); |
|
176int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **); 177int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *); 178boolean_t zfs_prop_valid_for_type(int, zfs_type_t); 179 180/* 181 * Pool property functions shared between libzfs and kernel. 182 */ 183zpool_prop_t zpool_name_to_prop(const char *); --- 28 unchanged lines hidden (view full) --- 212 ZFS_DELEG_PERM_LOCALDESCENDENT = 3, 213 ZFS_DELEG_PERM_CREATE = 4 214} zfs_deleg_inherit_t; 215 216#define ZFS_DELEG_PERM_UID "uid" 217#define ZFS_DELEG_PERM_GID "gid" 218#define ZFS_DELEG_PERM_GROUPS "groups" 219 | 188int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **); 189int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *); 190boolean_t zfs_prop_valid_for_type(int, zfs_type_t); 191 192/* 193 * Pool property functions shared between libzfs and kernel. 194 */ 195zpool_prop_t zpool_name_to_prop(const char *); --- 28 unchanged lines hidden (view full) --- 224 ZFS_DELEG_PERM_LOCALDESCENDENT = 3, 225 ZFS_DELEG_PERM_CREATE = 4 226} zfs_deleg_inherit_t; 227 228#define ZFS_DELEG_PERM_UID "uid" 229#define ZFS_DELEG_PERM_GID "gid" 230#define ZFS_DELEG_PERM_GROUPS "groups" 231 |
232#define ZFS_SMB_ACL_SRC "src" 233#define ZFS_SMB_ACL_TARGET "target" 234 |
|
220typedef enum { 221 ZFS_CANMOUNT_OFF = 0, 222 ZFS_CANMOUNT_ON = 1, 223 ZFS_CANMOUNT_NOAUTO = 2 224} zfs_canmount_type_t; 225 226typedef enum zfs_share_op { 227 ZFS_SHARE_NFS = 0, 228 ZFS_UNSHARE_NFS = 1, 229 ZFS_SHARE_SMB = 2, 230 ZFS_UNSHARE_SMB = 3 231} zfs_share_op_t; 232 | 235typedef enum { 236 ZFS_CANMOUNT_OFF = 0, 237 ZFS_CANMOUNT_ON = 1, 238 ZFS_CANMOUNT_NOAUTO = 2 239} zfs_canmount_type_t; 240 241typedef enum zfs_share_op { 242 ZFS_SHARE_NFS = 0, 243 ZFS_UNSHARE_NFS = 1, 244 ZFS_SHARE_SMB = 2, 245 ZFS_UNSHARE_SMB = 3 246} zfs_share_op_t; 247 |
248typedef enum zfs_smb_acl_op { 249 ZFS_SMB_ACL_ADD, 250 ZFS_SMB_ACL_REMOVE, 251 ZFS_SMB_ACL_RENAME, 252 ZFS_SMB_ACL_PURGE 253} zfs_smb_acl_op_t; 254 |
|
233typedef enum zfs_cache_type { 234 ZFS_CACHE_NONE = 0, 235 ZFS_CACHE_METADATA = 1, 236 ZFS_CACHE_ALL = 2 237} zfs_cache_type_t; 238 239 240/* --- 8 unchanged lines hidden (view full) --- 249#define SPA_VERSION_7 7ULL 250#define SPA_VERSION_8 8ULL 251#define SPA_VERSION_9 9ULL 252#define SPA_VERSION_10 10ULL 253#define SPA_VERSION_11 11ULL 254#define SPA_VERSION_12 12ULL 255#define SPA_VERSION_13 13ULL 256#define SPA_VERSION_14 14ULL | 255typedef enum zfs_cache_type { 256 ZFS_CACHE_NONE = 0, 257 ZFS_CACHE_METADATA = 1, 258 ZFS_CACHE_ALL = 2 259} zfs_cache_type_t; 260 261 262/* --- 8 unchanged lines hidden (view full) --- 271#define SPA_VERSION_7 7ULL 272#define SPA_VERSION_8 8ULL 273#define SPA_VERSION_9 9ULL 274#define SPA_VERSION_10 10ULL 275#define SPA_VERSION_11 11ULL 276#define SPA_VERSION_12 12ULL 277#define SPA_VERSION_13 13ULL 278#define SPA_VERSION_14 14ULL |
279#define SPA_VERSION_15 15ULL |
|
257/* 258 * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk 259 * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, | 280/* 281 * When bumping up SPA_VERSION, make sure GRUB ZFS understands the on-disk 282 * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*}, |
260 * and do the appropriate changes. | 283 * and do the appropriate changes. Also bump the version number in 284 * usr/src/grub/capability. |
261 */ | 285 */ |
262#define SPA_VERSION SPA_VERSION_14 263#define SPA_VERSION_STRING "14" | 286#define SPA_VERSION SPA_VERSION_15 287#define SPA_VERSION_STRING "15" |
264 265/* 266 * Symbolic names for the changes that caused a SPA_VERSION switch. 267 * Used in the code when checking for presence or absence of a feature. 268 * Feel free to define multiple symbolic names for each version if there 269 * were multiple changes to on-disk structures during that version. 270 * 271 * NOTE: When checking the current SPA_VERSION in your code, be sure --- 19 unchanged lines hidden (view full) --- 291#define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9 292#define SPA_VERSION_L2CACHE SPA_VERSION_10 293#define SPA_VERSION_NEXT_CLONES SPA_VERSION_11 294#define SPA_VERSION_ORIGIN SPA_VERSION_11 295#define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 296#define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 297#define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 298#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 | 288 289/* 290 * Symbolic names for the changes that caused a SPA_VERSION switch. 291 * Used in the code when checking for presence or absence of a feature. 292 * Feel free to define multiple symbolic names for each version if there 293 * were multiple changes to on-disk structures during that version. 294 * 295 * NOTE: When checking the current SPA_VERSION in your code, be sure --- 19 unchanged lines hidden (view full) --- 315#define SPA_VERSION_UNIQUE_ACCURATE SPA_VERSION_9 316#define SPA_VERSION_L2CACHE SPA_VERSION_10 317#define SPA_VERSION_NEXT_CLONES SPA_VERSION_11 318#define SPA_VERSION_ORIGIN SPA_VERSION_11 319#define SPA_VERSION_DSL_SCRUB SPA_VERSION_11 320#define SPA_VERSION_SNAP_PROPS SPA_VERSION_12 321#define SPA_VERSION_USED_BREAKDOWN SPA_VERSION_13 322#define SPA_VERSION_PASSTHROUGH_X SPA_VERSION_14 |
323#define SPA_VERSION_USERSPACE SPA_VERSION_15 |
|
299 300/* 301 * ZPL version - rev'd whenever an incompatible on-disk format change 302 * occurs. This is independent of SPA/DMU/ZAP versioning. You must 303 * also update the version_table[] and help message in zfs_prop.c. 304 * 305 * When changing, be sure to teach GRUB how to read the new format! 306 * See usr/src/grub/grub-0.95/stage2/{zfs-include/,fsys_zfs*} 307 */ 308#define ZPL_VERSION_1 1ULL 309#define ZPL_VERSION_2 2ULL 310#define ZPL_VERSION_3 3ULL | 324 325/* 326 * ZPL version - rev'd whenever an incompatible on-disk format change 327 * occurs. This is independent of SPA/DMU/ZAP versioning. You must 328 * also update the version_table[] and help message in zfs_prop.c. 329 * 330 * When changing, be sure to teach GRUB how to read the new format! 331 * See usr/src/grub/grub-0.95/stage2/{zfs-include/,fsys_zfs*} 332 */ 333#define ZPL_VERSION_1 1ULL 334#define ZPL_VERSION_2 2ULL 335#define ZPL_VERSION_3 3ULL |
311#define ZPL_VERSION ZPL_VERSION_3 312#define ZPL_VERSION_STRING "3" | 336#define ZPL_VERSION_4 4ULL 337#define ZPL_VERSION ZPL_VERSION_4 338#define ZPL_VERSION_STRING "4" |
313 314#define ZPL_VERSION_INITIAL ZPL_VERSION_1 315#define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2 316#define ZPL_VERSION_FUID ZPL_VERSION_3 317#define ZPL_VERSION_NORMALIZATION ZPL_VERSION_3 318#define ZPL_VERSION_SYSATTR ZPL_VERSION_3 | 339 340#define ZPL_VERSION_INITIAL ZPL_VERSION_1 341#define ZPL_VERSION_DIRENT_TYPE ZPL_VERSION_2 342#define ZPL_VERSION_FUID ZPL_VERSION_3 343#define ZPL_VERSION_NORMALIZATION ZPL_VERSION_3 344#define ZPL_VERSION_SYSATTR ZPL_VERSION_3 |
345#define ZPL_VERSION_USERSPACE ZPL_VERSION_4 |
|
319 320/* 321 * The following are configuration names used in the nvlist describing a pool's 322 * configuration. 323 */ 324#define ZPOOL_CONFIG_VERSION "version" 325#define ZPOOL_CONFIG_POOL_NAME "name" 326#define ZPOOL_CONFIG_POOL_STATE "state" --- 33 unchanged lines hidden (view full) --- 360 * The persistent vdev state is stored as separate values rather than a single 361 * 'vdev_state' entry. This is because a device can be in multiple states, such 362 * as offline and degraded. 363 */ 364#define ZPOOL_CONFIG_OFFLINE "offline" 365#define ZPOOL_CONFIG_FAULTED "faulted" 366#define ZPOOL_CONFIG_DEGRADED "degraded" 367#define ZPOOL_CONFIG_REMOVED "removed" | 346 347/* 348 * The following are configuration names used in the nvlist describing a pool's 349 * configuration. 350 */ 351#define ZPOOL_CONFIG_VERSION "version" 352#define ZPOOL_CONFIG_POOL_NAME "name" 353#define ZPOOL_CONFIG_POOL_STATE "state" --- 33 unchanged lines hidden (view full) --- 387 * The persistent vdev state is stored as separate values rather than a single 388 * 'vdev_state' entry. This is because a device can be in multiple states, such 389 * as offline and degraded. 390 */ 391#define ZPOOL_CONFIG_OFFLINE "offline" 392#define ZPOOL_CONFIG_FAULTED "faulted" 393#define ZPOOL_CONFIG_DEGRADED "degraded" 394#define ZPOOL_CONFIG_REMOVED "removed" |
395#define ZPOOL_CONFIG_FRU "fru" |
|
368 369#define VDEV_TYPE_ROOT "root" 370#define VDEV_TYPE_MIRROR "mirror" 371#define VDEV_TYPE_REPLACING "replacing" 372#define VDEV_TYPE_RAIDZ "raidz" 373#define VDEV_TYPE_DISK "disk" 374#define VDEV_TYPE_FILE "file" 375#define VDEV_TYPE_MISSING "missing" --- 187 unchanged lines hidden (view full) --- 563#define ZFS_IOC_POOL_GET_PROPS _IOWR('Z', 41, struct zfs_cmd) 564#define ZFS_IOC_SET_FSACL _IOWR('Z', 42, struct zfs_cmd) 565#define ZFS_IOC_GET_FSACL _IOWR('Z', 43, struct zfs_cmd) 566#define ZFS_IOC_ISCSI_PERM_CHECK _IOWR('Z', 44, struct zfs_cmd) 567#define ZFS_IOC_SHARE _IOWR('Z', 45, struct zfs_cmd) 568#define ZFS_IOC_INHERIT_PROP _IOWR('Z', 46, struct zfs_cmd) 569#define ZFS_IOC_JAIL _IOWR('Z', 47, struct zfs_cmd) 570#define ZFS_IOC_UNJAIL _IOWR('Z', 48, struct zfs_cmd) | 396 397#define VDEV_TYPE_ROOT "root" 398#define VDEV_TYPE_MIRROR "mirror" 399#define VDEV_TYPE_REPLACING "replacing" 400#define VDEV_TYPE_RAIDZ "raidz" 401#define VDEV_TYPE_DISK "disk" 402#define VDEV_TYPE_FILE "file" 403#define VDEV_TYPE_MISSING "missing" --- 187 unchanged lines hidden (view full) --- 591#define ZFS_IOC_POOL_GET_PROPS _IOWR('Z', 41, struct zfs_cmd) 592#define ZFS_IOC_SET_FSACL _IOWR('Z', 42, struct zfs_cmd) 593#define ZFS_IOC_GET_FSACL _IOWR('Z', 43, struct zfs_cmd) 594#define ZFS_IOC_ISCSI_PERM_CHECK _IOWR('Z', 44, struct zfs_cmd) 595#define ZFS_IOC_SHARE _IOWR('Z', 45, struct zfs_cmd) 596#define ZFS_IOC_INHERIT_PROP _IOWR('Z', 46, struct zfs_cmd) 597#define ZFS_IOC_JAIL _IOWR('Z', 47, struct zfs_cmd) 598#define ZFS_IOC_UNJAIL _IOWR('Z', 48, struct zfs_cmd) |
599#define ZFS_IOC_SMB_ACL _IOWR('Z', 49, struct zfs_cmd) 600#define ZFS_IOC_USERSPACE_ONE _IOWR('Z', 50, struct zfs_cmd) 601#define ZFS_IOC_USERSPACE_MANY _IOWR('Z', 51, struct zfs_cmd) 602#define ZFS_IOC_USERSPACE_UPGRADE _IOWR('Z', 52, struct zfs_cmd) 603#define ZFS_IOC_SETFRU _IOWR('Z', 53, struct zfs_cmd) |
|
571 572/* 573 * Internal SPA load state. Used by FMA diagnosis engine. 574 */ 575typedef enum { 576 SPA_LOAD_NONE, /* no load in progress */ 577 SPA_LOAD_OPEN, /* normal open */ 578 SPA_LOAD_IMPORT, /* import in progress */ --- 111 unchanged lines hidden --- | 604 605/* 606 * Internal SPA load state. Used by FMA diagnosis engine. 607 */ 608typedef enum { 609 SPA_LOAD_NONE, /* no load in progress */ 610 SPA_LOAD_OPEN, /* normal open */ 611 SPA_LOAD_IMPORT, /* import in progress */ --- 111 unchanged lines hidden --- |