usr/src/lib/libzfs/common/libzfs_impl.h
author Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
Tue, 16 Mar 2010 09:43:38 -0600
changeset 11935 538c866aaac6
parent 11876 5fce03ad05c6
child 13055 8c712bbb18ea
permissions -rw-r--r--
6716117 ZFS needs native system attribute infrastructure 6516171 zpl symlinks should have their own object type
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     1
/*
5951
c597da46efd6 6558321 zfs_share_nfs() fails the second time through
dougm
parents: 5367
diff changeset
     2
 * CDDL HEADER SART
789
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
 */
3126
4f4fb617fdd0 PSARC 2006/622 iSCSI/ZFS Integration
ahl
parents: 2885
diff changeset
    21
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    22
/*
11876
5fce03ad05c6 PSARC/2010/006 EOF of iSCSI Target Daemon
Jim Dunham <James.Dunham@Sun.COM>
parents: 11022
diff changeset
    23
 * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
 * Use is subject to license terms.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    25
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    26
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
#ifndef	_LIBFS_IMPL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
#define	_LIBFS_IMPL_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    29
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    30
#include <sys/dmu.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    31
#include <sys/fs/zfs.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    32
#include <sys/zfs_ioctl.h>
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4276
diff changeset
    33
#include <sys/spa.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    34
#include <sys/nvpair.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    35
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    36
#include <libuutil.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    37
#include <libzfs.h>
4180
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
    38
#include <libshare.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
10817
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    40
#include <fm/libtopo.h>
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    41
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    42
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    43
extern "C" {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    44
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    45
6442
b629b4fb30ca 6662212 libzfs should have a #define for VERIFY to assist backporting
gw25295
parents: 6423
diff changeset
    46
#ifdef	VERIFY
b629b4fb30ca 6662212 libzfs should have a #define for VERIFY to assist backporting
gw25295
parents: 6423
diff changeset
    47
#undef	VERIFY
b629b4fb30ca 6662212 libzfs should have a #define for VERIFY to assist backporting
gw25295
parents: 6423
diff changeset
    48
#endif
b629b4fb30ca 6662212 libzfs should have a #define for VERIFY to assist backporting
gw25295
parents: 6423
diff changeset
    49
#define	VERIFY	verify
b629b4fb30ca 6662212 libzfs should have a #define for VERIFY to assist backporting
gw25295
parents: 6423
diff changeset
    50
10817
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    51
typedef struct libzfs_fru {
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    52
	char *zf_device;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    53
	char *zf_fru;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    54
	struct libzfs_fru *zf_chain;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    55
	struct libzfs_fru *zf_next;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    56
} libzfs_fru_t;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    57
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    58
struct libzfs_handle {
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    59
	int libzfs_error;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    60
	int libzfs_fd;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    61
	FILE *libzfs_mnttab;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    62
	FILE *libzfs_sharetab;
6865
176d18c623cc 6539380 zfs list uses too much memory
rm160521
parents: 6442
diff changeset
    63
	zpool_handle_t *libzfs_pool_handles;
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    64
	uu_avl_pool_t *libzfs_ns_avlpool;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    65
	uu_avl_t *libzfs_ns_avl;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    66
	uint64_t libzfs_ns_gen;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    67
	int libzfs_desc_active;
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    68
	char libzfs_action[1024];
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    69
	char libzfs_desc[1024];
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4276
diff changeset
    70
	char *libzfs_log_str;
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    71
	int libzfs_printerr;
4180
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
    72
	void *libzfs_sharehdl; /* libshare handle */
5951
c597da46efd6 6558321 zfs_share_nfs() fails the second time through
dougm
parents: 5367
diff changeset
    73
	uint_t libzfs_shareflags;
8811
f8deccf701cf 6790687 libzfs mnttab caching ignores external changes
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 8802
diff changeset
    74
	boolean_t libzfs_mnttab_enable;
8228
51e9ca9ee3a5 6572357 libzfs should do more to avoid mnttab lookups
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 7366
diff changeset
    75
	avl_tree_t libzfs_mnttab_cache;
10817
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    76
	int libzfs_pool_iter;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    77
	topo_hdl_t *libzfs_topo_hdl;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    78
	libzfs_fru_t **libzfs_fru_hash;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    79
	libzfs_fru_t *libzfs_fru_list;
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    80
	char libzfs_chassis_id[256];
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    81
};
10817
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
    82
5951
c597da46efd6 6558321 zfs_share_nfs() fails the second time through
dougm
parents: 5367
diff changeset
    83
#define	ZFSSHARE_MISS	0x01	/* Didn't find entry in cache */
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    84
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    85
struct zfs_handle {
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
    86
	libzfs_handle_t *zfs_hdl;
6865
176d18c623cc 6539380 zfs list uses too much memory
rm160521
parents: 6442
diff changeset
    87
	zpool_handle_t *zpool_hdl;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    88
	char zfs_name[ZFS_MAXNAMELEN];
2885
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
    89
	zfs_type_t zfs_type; /* type including snapshot */
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
    90
	zfs_type_t zfs_head_type; /* type excluding snapshot */
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    91
	dmu_objset_stats_t zfs_dmustats;
1356
e021b5e4aa0e 6377671 zfs mount -a shouldn't bother checking snapshots
eschrock
parents: 1294
diff changeset
    92
	nvlist_t *zfs_props;
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
    93
	nvlist_t *zfs_user_props;
11022
63ab26072e41 PSARC 2009/510 ZFS received properties
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 10817
diff changeset
    94
	nvlist_t *zfs_recvd_props;
2474
c001ad7e0c25 6368751 libzfs interface for mount/umounting all the file systems for a given pool
eschrock
parents: 2142
diff changeset
    95
	boolean_t zfs_mntcheck;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    96
	char *zfs_mntopts;
8802
010b31dd4c53 6773366 "zfs list" memory consumption can be further reduced
Sanjeev Bagewadi <Sanjeev.Bagewadi@Sun.COM>
parents: 8228
diff changeset
    97
	uint8_t *zfs_props_table;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    98
};
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    99
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   100
/*
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   101
 * This is different from checking zfs_type, because it will also catch
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   102
 * snapshots of volumes.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   103
 */
2885
c0259887ebbc 6460059 zfs destroy <snapshot> leaves behind kruft
ahrens
parents: 2676
diff changeset
   104
#define	ZFS_IS_VOLUME(zhp) ((zhp)->zfs_head_type == ZFS_TYPE_VOLUME)
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   105
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   106
struct zpool_handle {
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   107
	libzfs_handle_t *zpool_hdl;
6865
176d18c623cc 6539380 zfs list uses too much memory
rm160521
parents: 6442
diff changeset
   108
	zpool_handle_t *zpool_next;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   109
	char zpool_name[ZPOOL_MAXNAMELEN];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   110
	int zpool_state;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   111
	size_t zpool_config_size;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   112
	nvlist_t *zpool_config;
952
12ec54aa046e 6344502 placeholder bug for the remaining Makefile cleanup work for ZFS
eschrock
parents: 789
diff changeset
   113
	nvlist_t *zpool_old_config;
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3741
diff changeset
   114
	nvlist_t *zpool_props;
4276
c42d49ffb16f 6385547 zpool create of a mirror using a device and a slice of a device (of same size) reports an error
taylor
parents: 4180
diff changeset
   115
	diskaddr_t zpool_start_block;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   116
};
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   117
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   118
typedef  enum {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   119
	PROTO_NFS = 0,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   120
	PROTO_SMB = 1,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   121
	PROTO_END = 2
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   122
} zfs_share_proto_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   123
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   124
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   125
 * The following can be used as a bitmask and any new values
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   126
 * added must preserve that capability.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   127
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   128
typedef enum {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   129
	SHARED_NOT_SHARED = 0x0,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   130
	SHARED_NFS = 0x2,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   131
	SHARED_SMB = 0x4
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   132
} zfs_share_type_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   133
3237
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   134
int zfs_error(libzfs_handle_t *, int, const char *);
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   135
int zfs_error_fmt(libzfs_handle_t *, int, const char *, ...);
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   136
void zfs_error_aux(libzfs_handle_t *, const char *, ...);
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   137
void *zfs_alloc(libzfs_handle_t *, size_t);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   138
void *zfs_realloc(libzfs_handle_t *, void *, size_t, size_t);
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   139
char *zfs_strdup(libzfs_handle_t *, const char *);
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   140
int no_memory(libzfs_handle_t *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   141
3237
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   142
int zfs_standard_error(libzfs_handle_t *, int, const char *);
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   143
int zfs_standard_error_fmt(libzfs_handle_t *, int, const char *, ...);
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   144
int zpool_standard_error(libzfs_handle_t *, int, const char *);
98d0c28f2f5e 6480245 renaming a dataset to something with '%s' will cause segfault
lling
parents: 3126
diff changeset
   145
int zpool_standard_error_fmt(libzfs_handle_t *, int, const char *, ...);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   146
2474
c001ad7e0c25 6368751 libzfs interface for mount/umounting all the file systems for a given pool
eschrock
parents: 2142
diff changeset
   147
int get_dependents(libzfs_handle_t *, boolean_t, const char *, char ***,
c001ad7e0c25 6368751 libzfs interface for mount/umounting all the file systems for a given pool
eschrock
parents: 2142
diff changeset
   148
    size_t *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   149
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3741
diff changeset
   150
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   151
int zprop_parse_value(libzfs_handle_t *, nvpair_t *, int, zfs_type_t,
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   152
    nvlist_t *, char **, uint64_t *, const char *);
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   153
int zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp,
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   154
    zfs_type_t type);
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3741
diff changeset
   155
7366
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   156
/*
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   157
 * Use this changelist_gather() flag to force attempting mounts
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   158
 * on each change node regardless of whether or not it is currently
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   159
 * mounted.
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   160
 */
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   161
#define	CL_GATHER_MOUNT_ALWAYS	1
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   162
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   163
typedef struct prop_changelist prop_changelist_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   164
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   165
int zcmd_alloc_dst_nvlist(libzfs_handle_t *, zfs_cmd_t *, size_t);
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   166
int zcmd_write_src_nvlist(libzfs_handle_t *, zfs_cmd_t *, nvlist_t *);
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4715
diff changeset
   167
int zcmd_write_conf_nvlist(libzfs_handle_t *, zfs_cmd_t *, nvlist_t *);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   168
int zcmd_expand_dst_nvlist(libzfs_handle_t *, zfs_cmd_t *);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   169
int zcmd_read_dst_nvlist(libzfs_handle_t *, zfs_cmd_t *, nvlist_t **);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   170
void zcmd_free_nvlists(zfs_cmd_t *);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2474
diff changeset
   171
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   172
int changelist_prefix(prop_changelist_t *);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   173
int changelist_postfix(prop_changelist_t *);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   174
void changelist_rename(prop_changelist_t *, const char *, const char *);
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   175
void changelist_remove(prop_changelist_t *, const char *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   176
void changelist_free(prop_changelist_t *);
7366
33de5956afbb 6678308 zfs receive dumps core when -n is used, fails on replication stream
Tim Haley <Tim.Haley@Sun.COM>
parents: 6865
diff changeset
   177
prop_changelist_t *changelist_gather(zfs_handle_t *, zfs_prop_t, int, int);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   178
int changelist_unshare(prop_changelist_t *, zfs_share_proto_t *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   179
int changelist_haszonedchild(prop_changelist_t *);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   180
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   181
void remove_mountpoint(zfs_handle_t *);
5367
c40abbe796be PSARC/2007/574 zfs send -R
ahrens
parents: 5331
diff changeset
   182
int create_parents(libzfs_handle_t *, char *, int);
6027
68b03551f113 6609196 'zfs destroy -r' can needlessly iterate over all filesystems in pool
rm160521
parents: 5951
diff changeset
   183
boolean_t isa_child_of(const char *dataset, const char *parent);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   184
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   185
zfs_handle_t *make_dataset_handle(libzfs_handle_t *, const char *);
1544
938876158511 PSARC 2006/077 zpool clear
eschrock
parents: 1356
diff changeset
   186
2142
f6e0487aa9a3 6433264 crash when adding spare: nvlist_lookup_string(cnv, "path", &path) == 0
eschrock
parents: 2082
diff changeset
   187
int zpool_open_silent(libzfs_handle_t *, const char *, zpool_handle_t **);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   188
6423
437422a29d3a PSARC 2006/370 ZFS Boot Support
gw25295
parents: 6027
diff changeset
   189
boolean_t zpool_name_valid(libzfs_handle_t *, boolean_t, const char *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   190
2082
76b439ec3ac1 PSARC 2006/223 ZFS Hot Spares
eschrock
parents: 1544
diff changeset
   191
void namespace_clear(libzfs_handle_t *);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   192
4180
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   193
/*
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   194
 * libshare (sharemgr) interfaces used internally.
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   195
 */
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   196
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   197
extern int zfs_init_libshare(libzfs_handle_t *, int);
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   198
extern void zfs_uninit_libshare(libzfs_handle_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   199
extern int zfs_parse_options(char *, zfs_share_proto_t);
4180
30b15f0bd3c9 6491973 sharemgr: zfs set sharenfs=on is slow with lots of zfs filesystems
dougm
parents: 3912
diff changeset
   200
8845
91af0d9c0790 6800942 smb_session_create() incorrectly stores IP addresses
Alan Wright <amw@Sun.COM>
parents: 8811
diff changeset
   201
extern int zfs_unshare_proto(zfs_handle_t *,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   202
    const char *, zfs_share_proto_t *);
10817
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
   203
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
   204
extern void libzfs_fru_clear(libzfs_handle_t *, boolean_t);
7dfde45252f0 6889826 ZFS retire agent should be able to repair pools
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10588
diff changeset
   205
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   206
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   207
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   208
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   209
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   210
#endif	/* _LIBFS_IMPL_H */