usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h
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--
6938335 zfs send -R can still miss renamed snapshots 6955879 panic in dmu_objset_stats while running nfs IOs. 6928104 zfs send/rename race can leak snapshot holds 6953835 mem leak in dsl_dataset_user_release_tmp() 6915117 zfs_iter_snapshots() should deal with midstream snapshot renames
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
/*
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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    23
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    25
#ifndef	_SYS_ZFS_IOCTL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    26
#define	_SYS_ZFS_IOCTL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
#include <sys/cred.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    29
#include <sys/dmu.h>
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
    30
#include <sys/zio.h>
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
    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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    33
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
    34
#ifdef _KERNEL
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
    35
#include <sys/nvpair.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
    36
#endif	/* _KERNEL */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
    37
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    38
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
extern "C" {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    40
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    41
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    42
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    43
 * Property values for snapdir
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   101
#define	DMU_BACKUP_MAGIC 0x2F5bacbacULL
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   105
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   115
 * zfs ioctl command structure
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   116
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   117
typedef struct dmu_replay_record {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   118
	enum {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   122
	} drr_type;
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   123
	uint32_t drr_payloadlen;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   124
	union {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   125
		struct drr_begin {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   128
			uint64_t drr_creation_time;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   129
			dmu_objset_type_t drr_type;
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   130
			uint32_t drr_flags;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   131
			uint64_t drr_toguid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   132
			uint64_t drr_fromguid;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   133
			char drr_toname[MAXNAMELEN];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   134
		} drr_begin;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   135
		struct drr_end {
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   138
		} drr_end;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   139
		struct drr_object {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   140
			uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   141
			dmu_object_type_t drr_type;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   142
			dmu_object_type_t drr_bonustype;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   143
			uint32_t drr_blksz;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   146
			uint8_t drr_compress;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
   149
			/* bonus content follows */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   150
		} drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   151
		struct drr_freeobjects {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   152
			uint64_t drr_firstobj;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   155
		} drr_freeobjects;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   156
		struct drr_write {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   157
			uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   158
			dmu_object_type_t drr_type;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   159
			uint32_t drr_pad;
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;
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
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
   167
			/* content follows */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   168
		} drr_write;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   169
		struct drr_free {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   170
			uint64_t drr_object;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   171
			uint64_t drr_offset;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   198
	} drr_u;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   199
} dmu_replay_record_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   200
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   201
typedef struct zinject_record {
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   202
	uint64_t	zi_objset;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   203
	uint64_t	zi_object;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   204
	uint64_t	zi_start;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   205
	uint64_t	zi_end;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   206
	uint64_t	zi_guid;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   207
	uint32_t	zi_level;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   208
	uint32_t	zi_error;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   209
	uint64_t	zi_type;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   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
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   216
} zinject_record_t;
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   217
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   218
#define	ZINJECT_NULL		0x1
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   219
#define	ZINJECT_FLUSH_ARC	0x2
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   220
#define	ZINJECT_UNLOAD_SPA	0x4
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   221
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   222
typedef struct zfs_share {
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   223
	uint64_t	z_exportdata;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   224
	uint64_t	z_sharedata;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   225
	uint64_t	z_sharetype;	/* 0 = share, 1 = unshare */
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   226
	uint64_t	z_sharemax;  /* max length of share string */
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   227
} zfs_share_t;
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   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
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   246
	uint64_t	zc_guid;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
   247
	uint64_t	zc_nvlist_conf;		/* really (char *) */
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
   248
	uint64_t	zc_nvlist_conf_size;
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
   249
	uint64_t	zc_nvlist_src;		/* really (char *) */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2467
diff changeset
   250
	uint64_t	zc_nvlist_src_size;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
   251
	uint64_t	zc_nvlist_dst;		/* really (char *) */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2467
diff changeset
   252
	uint64_t	zc_nvlist_dst_size;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   253
	uint64_t	zc_cookie;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   254
	uint64_t	zc_objset_type;
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   255
	uint64_t	zc_perm_action;
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4787
diff changeset
   256
	uint64_t 	zc_history;		/* really (char *) */
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   257
	uint64_t 	zc_history_len;
2926
acfcfefbc60d PSARC 2006/288 zpool history
ek110237
parents: 2885
diff changeset
   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
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   261
	zfs_share_t	zc_share;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   262
	dmu_objset_stats_t zc_objset_stats;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   263
	struct drr_begin zc_begin_record;
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   273
} zfs_cmd_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   287
#ifdef _KERNEL
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   288
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   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
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   291
	nvlist_t	*zct_props;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   292
} zfs_creat_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   293
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   294
extern dev_info_t *zfs_dip;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   295
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   296
extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   297
extern int zfs_secpolicy_rename_perms(const char *from,
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   298
    const char *to, cred_t *cr);
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4007
diff changeset
   299
extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   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
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   325
#endif	/* _KERNEL */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   326
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   327
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   328
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   329
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   330
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   331
#endif	/* _SYS_ZFS_IOCTL_H */