usr/src/uts/common/fs/zfs/sys/zap.h
author Christopher Siden <chris.siden@delphix.com>
Mon, 21 May 2012 12:11:39 -0700
changeset 13700 2889e2596bd6
parent 12450 c77e20e4e046
child 13782 8f78aae28a63
permissions -rw-r--r--
2619 asynchronous destruction of ZFS file systems 2747 SPA versioning with zfs feature flags Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Richard Lowe <[email protected]> Reviewed by: Dan Kruchinin <[email protected]> Approved by: Eric Schrock <[email protected]>
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
1578
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
     5
 * Common Development and Distribution License (the "License").
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
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
/*
12296
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
    22
 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
13700
2889e2596bd6 2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents: 12450
diff changeset
    23
 * Copyright (c) 2012 by Delphix. All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    25
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    26
#ifndef	_SYS_ZAP_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
#define	_SYS_ZAP_H
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    29
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    30
 * ZAP - ZFS Attribute Processor
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    31
 *
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    32
 * The ZAP is a module which sits on top of the DMU (Data Management
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    33
 * Unit) and implements a higher-level storage primitive using DMU
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    34
 * objects.  Its primary consumer is the ZPL (ZFS Posix Layer).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    35
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    36
 * A "zapobj" is a DMU object which the ZAP uses to stores attributes.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    37
 * Users should use only zap routines to access a zapobj - they should
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    38
 * not access the DMU object directly using DMU routines.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    40
 * The attributes stored in a zapobj are name-value pairs.  The name is
1578
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    41
 * a zero-terminated string of up to ZAP_MAXNAMELEN bytes (including
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    42
 * terminating NULL).  The value is an array of integers, which may be
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    43
 * 1, 2, 4, or 8 bytes long.  The total space used by the array (number
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    44
 * of integers * integer length) can be up to ZAP_MAXVALUELEN bytes.
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    45
 * Note that an 8-byte integer value can be used to store the location
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    46
 * (object number) of another dmu object (which may be itself a zapobj).
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    47
 * Note that you can use a zero-length attribute to store a single bit
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    48
 * of information - the attribute is present or not.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    49
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    50
 * The ZAP routines are thread-safe.  However, you must observe the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    51
 * DMU's restriction that a transaction may not be operated on
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    52
 * concurrently.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    53
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    54
 * Any of the routines that return an int may return an I/O error (EIO
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    55
 * or ECHECKSUM).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    56
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    57
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    58
 * Implementation / Performance Notes:
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    59
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    60
 * The ZAP is intended to operate most efficiently on attributes with
1578
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    61
 * short (49 bytes or less) names and single 8-byte values, for which
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    62
 * the microzap will be used.  The ZAP should be efficient enough so
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    63
 * that the user does not need to cache these attributes.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    64
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    65
 * The ZAP's locking scheme makes its routines thread-safe.  Operations
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    66
 * on different zapobjs will be processed concurrently.  Operations on
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    67
 * the same zapobj which only read data will be processed concurrently.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    68
 * Operations on the same zapobj which modify data will be processed
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    69
 * concurrently when there are many attributes in the zapobj (because
1578
1fd8ab638fc0 6389897 remove zap leaf chaining code as it is never used
ahrens
parents: 885
diff changeset
    70
 * the ZAP uses per-block locking - more than 128 * (number of cpus)
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    71
 * small attributes will suffice).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    72
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    73
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    74
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    75
 * We're using zero-terminated byte strings (ie. ASCII or UTF-8 C
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    76
 * strings) for the names of attributes, rather than a byte string
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    77
 * bounded by an explicit length.  If some day we want to support names
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    78
 * in character sets which have embedded zeros (eg. UTF-16, UTF-32),
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    79
 * we'll have to add routines for using length-bounded strings.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    80
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    81
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    82
#include <sys/dmu.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    83
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    84
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    85
extern "C" {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    86
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    87
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    88
/*
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    89
 * The matchtype specifies which entry will be accessed.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    90
 * MT_EXACT: only find an exact match (non-normalized)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    91
 * MT_FIRST: find the "first" normalized (case and Unicode
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    92
 *     form) match; the designated "first" match will not change as long
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    93
 *     as the set of entries with this normalization doesn't change
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    94
 * MT_BEST: if there is an exact match, find that, otherwise find the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    95
 *     first normalized match
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    96
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    97
typedef enum matchtype
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    98
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
    99
	MT_EXACT,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   100
	MT_BEST,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   101
	MT_FIRST
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   102
} matchtype_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   103
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   104
typedef enum zap_flags {
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   105
	/* Use 64-bit hash value (serialized cursors will always use 64-bits) */
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   106
	ZAP_FLAG_HASH64 = 1 << 0,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   107
	/* Key is binary, not string (zap_add_uint64() can be used) */
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   108
	ZAP_FLAG_UINT64_KEY = 1 << 1,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   109
	/*
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   110
	 * First word of key (which must be an array of uint64) is
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   111
	 * already randomly distributed.
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   112
	 */
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   113
	ZAP_FLAG_PRE_HASHED_KEY = 1 << 2,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   114
} zap_flags_t;
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   115
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   116
/*
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   117
 * Create a new zapobj with no attributes and return its object number.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   118
 * MT_EXACT will cause the zap object to only support MT_EXACT lookups,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   119
 * otherwise any matchtype can be used for lookups.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   120
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   121
 * normflags specifies what normalization will be done.  values are:
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   122
 * 0: no normalization (legacy on-disk format, supports MT_EXACT matching
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   123
 *     only)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   124
 * U8_TEXTPREP_TOLOWER: case normalization will be performed.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   125
 *     MT_FIRST/MT_BEST matching will find entries that match without
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   126
 *     regard to case (eg. looking for "foo" can find an entry "Foo").
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   127
 * Eventually, other flags will permit unicode normalization as well.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   128
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   129
uint64_t zap_create(objset_t *ds, dmu_object_type_t ot,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   130
    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   131
uint64_t zap_create_norm(objset_t *ds, int normflags, dmu_object_type_t ot,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   132
    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   133
uint64_t zap_create_flags(objset_t *os, int normflags, zap_flags_t flags,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   134
    dmu_object_type_t ot, int leaf_blockshift, int indirect_blockshift,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   135
    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
13700
2889e2596bd6 2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents: 12450
diff changeset
   136
uint64_t zap_create_link(objset_t *os, dmu_object_type_t ot,
2889e2596bd6 2619 asynchronous destruction of ZFS file systems
Christopher Siden <chris.siden@delphix.com>
parents: 12450
diff changeset
   137
    uint64_t parent_obj, const char *name, dmu_tx_t *tx);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   138
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   139
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   140
 * Create a new zapobj with no attributes from the given (unallocated)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   141
 * object number.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   142
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   143
int zap_create_claim(objset_t *ds, uint64_t obj, dmu_object_type_t ot,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   144
    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   145
int zap_create_claim_norm(objset_t *ds, uint64_t obj,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   146
    int normflags, dmu_object_type_t ot,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   147
    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   148
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   149
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   150
 * The zapobj passed in must be a valid ZAP object for all of the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   151
 * following routines.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   152
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   153
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   154
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   155
 * Destroy this zapobj and all its attributes.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   156
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   157
 * Frees the object number using dmu_object_free.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   158
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   159
int zap_destroy(objset_t *ds, uint64_t zapobj, dmu_tx_t *tx);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   160
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   161
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   162
 * Manipulate attributes.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   163
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   164
 * 'integer_size' is in bytes, and must be 1, 2, 4, or 8.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   165
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   166
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   167
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   168
 * Retrieve the contents of the attribute with the given name.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   169
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   170
 * If the requested attribute does not exist, the call will fail and
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   171
 * return ENOENT.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   172
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   173
 * If 'integer_size' is smaller than the attribute's integer size, the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   174
 * call will fail and return EINVAL.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   175
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   176
 * If 'integer_size' is equal to or larger than the attribute's integer
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   177
 * size, the call will succeed and return 0.  * When converting to a
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   178
 * larger integer size, the integers will be treated as unsigned (ie. no
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   179
 * sign-extension will be performed).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   180
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   181
 * 'num_integers' is the length (in integers) of 'buf'.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   182
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   183
 * If the attribute is longer than the buffer, as many integers as will
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   184
 * fit will be transferred to 'buf'.  If the entire attribute was not
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   185
 * transferred, the call will return EOVERFLOW.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   186
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   187
 * If rn_len is nonzero, realname will be set to the name of the found
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   188
 * entry (which may be different from the requested name if matchtype is
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   189
 * not MT_EXACT).
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   190
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   191
 * If normalization_conflictp is not NULL, it will be set if there is
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   192
 * another name with the same case/unicode normalized form.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   193
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   194
int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   195
    uint64_t integer_size, uint64_t num_integers, void *buf);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   196
int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   197
    uint64_t integer_size, uint64_t num_integers, void *buf,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   198
    matchtype_t mt, char *realname, int rn_len,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   199
    boolean_t *normalization_conflictp);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   200
int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   201
    int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
11022
63ab26072e41 PSARC 2009/510 ZFS received properties
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 10922
diff changeset
   202
int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
12450
c77e20e4e046 6938089 dedup-induced latency causes FC initiator logouts/FC port resets
George Wilson <George.Wilson@Sun.COM>
parents: 12296
diff changeset
   203
int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
c77e20e4e046 6938089 dedup-induced latency causes FC initiator logouts/FC port resets
George Wilson <George.Wilson@Sun.COM>
parents: 12296
diff changeset
   204
    int key_numints);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   205
9653
a70048a304d1 6664765 Unable to remove files when using fat-zap and quota exceeded on ZFS filesystem
Sanjeev Bagewadi <Sanjeev.Bagewadi@Sun.COM>
parents: 9643
diff changeset
   206
int zap_count_write(objset_t *os, uint64_t zapobj, const char *name,
9873
8ddc892eca6e 6847229 assertion failed: refcount_count(&tx->tx_space_written) + delta <= tx->tx_space_towrite in dmu_tx.c
Sanjeev Bagewadi <Sanjeev.Bagewadi@Sun.COM>
parents: 9653
diff changeset
   207
    int add, uint64_t *towrite, uint64_t *tooverwrite);
9653
a70048a304d1 6664765 Unable to remove files when using fat-zap and quota exceeded on ZFS filesystem
Sanjeev Bagewadi <Sanjeev.Bagewadi@Sun.COM>
parents: 9643
diff changeset
   208
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   209
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   210
 * Create an attribute with the given name and value.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   211
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   212
 * If an attribute with the given name already exists, the call will
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   213
 * fail and return EEXIST.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   214
 */
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   215
int zap_add(objset_t *ds, uint64_t zapobj, const char *key,
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   216
    int integer_size, uint64_t num_integers,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   217
    const void *val, dmu_tx_t *tx);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   218
int zap_add_uint64(objset_t *ds, uint64_t zapobj, const uint64_t *key,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   219
    int key_numints, int integer_size, uint64_t num_integers,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   220
    const void *val, dmu_tx_t *tx);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   221
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   222
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   223
 * Set the attribute with the given name to the given value.  If an
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   224
 * attribute with the given name does not exist, it will be created.  If
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   225
 * an attribute with the given name already exists, the previous value
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   226
 * will be overwritten.  The integer_size may be different from the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   227
 * existing attribute's integer size, in which case the attribute's
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   228
 * integer size will be updated to the new value.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   229
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   230
int zap_update(objset_t *ds, uint64_t zapobj, const char *name,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   231
    int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   232
int zap_update_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   233
    int key_numints,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   234
    int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   235
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   236
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   237
 * Get the length (in integers) and the integer size of the specified
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   238
 * attribute.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   239
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   240
 * If the requested attribute does not exist, the call will fail and
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   241
 * return ENOENT.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   242
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   243
int zap_length(objset_t *ds, uint64_t zapobj, const char *name,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   244
    uint64_t *integer_size, uint64_t *num_integers);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   245
int zap_length_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   246
    int key_numints, uint64_t *integer_size, uint64_t *num_integers);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   247
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   248
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   249
 * Remove the specified attribute.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   250
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   251
 * If the specified attribute does not exist, the call will fail and
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   252
 * return ENOENT.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   253
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   254
int zap_remove(objset_t *ds, uint64_t zapobj, const char *name, dmu_tx_t *tx);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   255
int zap_remove_norm(objset_t *ds, uint64_t zapobj, const char *name,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   256
    matchtype_t mt, dmu_tx_t *tx);
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   257
int zap_remove_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   258
    int key_numints, dmu_tx_t *tx);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   259
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   260
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   261
 * Returns (in *count) the number of attributes in the specified zap
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   262
 * object.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   263
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   264
int zap_count(objset_t *ds, uint64_t zapobj, uint64_t *count);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   265
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   266
/*
4577
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 1632
diff changeset
   267
 * Returns (in name) the name of the entry whose (value & mask)
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   268
 * (za_first_integer) is value, or ENOENT if not found.  The string
4577
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 1632
diff changeset
   269
 * pointed to by name must be at least 256 bytes long.  If mask==0, the
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 1632
diff changeset
   270
 * match must be exact (ie, same as mask=-1ULL).
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   271
 */
4577
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 1632
diff changeset
   272
int zap_value_search(objset_t *os, uint64_t zapobj,
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 1632
diff changeset
   273
    uint64_t value, uint64_t mask, char *name);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   274
7046
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   275
/*
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   276
 * Transfer all the entries from fromobj into intoobj.  Only works on
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   277
 * int_size=8 num_integers=1 values.  Fails if there are any duplicated
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   278
 * entries.
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   279
 */
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   280
int zap_join(objset_t *os, uint64_t fromobj, uint64_t intoobj, dmu_tx_t *tx);
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   281
12296
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   282
/* Same as zap_join, but set the values to 'value'. */
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   283
int zap_join_key(objset_t *os, uint64_t fromobj, uint64_t intoobj,
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   284
    uint64_t value, dmu_tx_t *tx);
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   285
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   286
/* Same as zap_join, but add together any duplicated entries. */
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   287
int zap_join_increment(objset_t *os, uint64_t fromobj, uint64_t intoobj,
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   288
    dmu_tx_t *tx);
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   289
7046
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   290
/*
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   291
 * Manipulate entries where the name + value are the "same" (the name is
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   292
 * a stringified version of the value).
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   293
 */
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   294
int zap_add_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   295
int zap_remove_int(objset_t *os, uint64_t obj, uint64_t value, dmu_tx_t *tx);
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   296
int zap_lookup_int(objset_t *os, uint64_t obj, uint64_t value);
10407
34e10c4af053 6875779 zfs user accounting callbacks can be simplified
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 9873
diff changeset
   297
int zap_increment_int(objset_t *os, uint64_t obj, uint64_t key, int64_t delta,
34e10c4af053 6875779 zfs user accounting callbacks can be simplified
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 9873
diff changeset
   298
    dmu_tx_t *tx);
7046
361307ae060d 6343667 scrub/resilver has to start over when a snapshot is taken
ahrens
parents: 5331
diff changeset
   299
12296
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   300
/* Here the key is an int and the value is a different int. */
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   301
int zap_add_int_key(objset_t *os, uint64_t obj,
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   302
    uint64_t key, uint64_t value, dmu_tx_t *tx);
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   303
int zap_lookup_int_key(objset_t *os, uint64_t obj,
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   304
    uint64_t key, uint64_t *valuep);
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   305
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   306
int zap_increment(objset_t *os, uint64_t obj, const char *name, int64_t delta,
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   307
    dmu_tx_t *tx);
7cf402a7f374 6675946 'zpool status' should show the progress of resilvering for individual disk.
Lin Ling <Lin.Ling@Sun.COM>
parents: 11022
diff changeset
   308
885
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   309
struct zap;
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   310
struct zap_leaf;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   311
typedef struct zap_cursor {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   312
	/* This structure is opaque! */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   313
	objset_t *zc_objset;
885
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   314
	struct zap *zc_zap;
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   315
	struct zap_leaf *zc_leaf;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   316
	uint64_t zc_zapobj;
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10612
diff changeset
   317
	uint64_t zc_serialized;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   318
	uint64_t zc_hash;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   319
	uint32_t zc_cd;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   320
} zap_cursor_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   321
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   322
typedef struct {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   323
	int za_integer_length;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   324
	/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   325
	 * za_normalization_conflict will be set if there are additional
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   326
	 * entries with this normalized form (eg, "foo" and "Foo").
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   327
	 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 4577
diff changeset
   328
	boolean_t za_normalization_conflict;
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   329
	uint64_t za_num_integers;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   330
	uint64_t za_first_integer;	/* no sign extension for <8byte ints */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   331
	char za_name[MAXNAMELEN];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   332
} zap_attribute_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   333
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   334
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   335
 * The interface for listing all the attributes of a zapobj can be
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   336
 * thought of as cursor moving down a list of the attributes one by
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   337
 * one.  The cookie returned by the zap_cursor_serialize routine is
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   338
 * persistent across system calls (and across reboot, even).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   339
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   340
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   341
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   342
 * Initialize a zap cursor, pointing to the "first" attribute of the
885
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   343
 * zapobj.  You must _fini the cursor when you are done with it.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   344
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   345
void zap_cursor_init(zap_cursor_t *zc, objset_t *ds, uint64_t zapobj);
885
d925b21dba78 6347493 tar of 25K empty directory entries in ZFS takes 30+ seconds ...
ahrens
parents: 789
diff changeset
   346
void zap_cursor_fini(zap_cursor_t *zc);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   347
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   348
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   349
 * Get the attribute currently pointed to by the cursor.  Returns
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   350
 * ENOENT if at the end of the attributes.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   351
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   352
int zap_cursor_retrieve(zap_cursor_t *zc, zap_attribute_t *za);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   353
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   354
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   355
 * Advance the cursor to the next attribute.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   356
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   357
void zap_cursor_advance(zap_cursor_t *zc);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   358
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   359
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   360
 * Get a persistent cookie pointing to the current position of the zap
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   361
 * cursor.  The low 4 bits in the cookie are always zero, and thus can
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   362
 * be used as to differentiate a serialized cookie from a different type
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   363
 * of value.  The cookie will be less than 2^32 as long as there are
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   364
 * fewer than 2^22 (4.2 million) entries in the zap object.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   365
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   366
uint64_t zap_cursor_serialize(zap_cursor_t *zc);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   367
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   368
/*
10612
89423355fa6f 6650218 Commit callbacks API for the DMU
Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
parents: 10407
diff changeset
   369
 * Advance the cursor to the attribute having the given key.
89423355fa6f 6650218 Commit callbacks API for the DMU
Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
parents: 10407
diff changeset
   370
 */
89423355fa6f 6650218 Commit callbacks API for the DMU
Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
parents: 10407
diff changeset
   371
int zap_cursor_move_to_key(zap_cursor_t *zc, const char *name, matchtype_t mt);
89423355fa6f 6650218 Commit callbacks API for the DMU
Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
parents: 10407
diff changeset
   372
89423355fa6f 6650218 Commit callbacks API for the DMU
Ricardo M. Correia <Ricardo.M.Correia@Sun.COM>
parents: 10407
diff changeset
   373
/*
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   374
 * Initialize a zap cursor pointing to the position recorded by
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   375
 * zap_cursor_serialize (in the "serialized" argument).  You can also
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   376
 * use a "serialized" argument of 0 to start at the beginning of the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   377
 * zapobj (ie.  zap_cursor_init_serialized(..., 0) is equivalent to
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   378
 * zap_cursor_init(...).)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   379
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   380
void zap_cursor_init_serialized(zap_cursor_t *zc, objset_t *ds,
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   381
    uint64_t zapobj, uint64_t serialized);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   382
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   383
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   384
#define	ZAP_HISTOGRAM_SIZE 10
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   385
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   386
typedef struct zap_stats {
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   387
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   388
	 * Size of the pointer table (in number of entries).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   389
	 * This is always a power of 2, or zero if it's a microzap.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   390
	 * In general, it should be considerably greater than zs_num_leafs.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   391
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   392
	uint64_t zs_ptrtbl_len;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   393
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   394
	uint64_t zs_blocksize;		/* size of zap blocks */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   395
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   396
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   397
	 * The number of blocks used.  Note that some blocks may be
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   398
	 * wasted because old ptrtbl's and large name/value blocks are
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   399
	 * not reused.  (Although their space is reclaimed, we don't
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   400
	 * reuse those offsets in the object.)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   401
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   402
	uint64_t zs_num_blocks;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   403
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   404
	/*
1632
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   405
	 * Pointer table values from zap_ptrtbl in the zap_phys_t
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   406
	 */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   407
	uint64_t zs_ptrtbl_nextblk;	  /* next (larger) copy start block */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   408
	uint64_t zs_ptrtbl_blks_copied;   /* number source blocks copied */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   409
	uint64_t zs_ptrtbl_zt_blk;	  /* starting block number */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   410
	uint64_t zs_ptrtbl_zt_numblks;    /* number of blocks */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   411
	uint64_t zs_ptrtbl_zt_shift;	  /* bits to index it */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   412
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   413
	/*
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   414
	 * Values of the other members of the zap_phys_t
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   415
	 */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   416
	uint64_t zs_block_type;		/* ZBT_HEADER */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   417
	uint64_t zs_magic;		/* ZAP_MAGIC */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   418
	uint64_t zs_num_leafs;		/* The number of leaf blocks */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   419
	uint64_t zs_num_entries;	/* The number of zap entries */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   420
	uint64_t zs_salt;		/* salt to stir into hash function */
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   421
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   422
	/*
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   423
	 * Histograms.  For all histograms, the last index
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   424
	 * (ZAP_HISTOGRAM_SIZE-1) includes any values which are greater
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   425
	 * than what can be represented.  For example
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   426
	 * zs_leafs_with_n5_entries[ZAP_HISTOGRAM_SIZE-1] is the number
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   427
	 * of leafs with more than 45 entries.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   428
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   429
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   430
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   431
	 * zs_leafs_with_n_pointers[n] is the number of leafs with
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   432
	 * 2^n pointers to it.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   433
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   434
	uint64_t zs_leafs_with_2n_pointers[ZAP_HISTOGRAM_SIZE];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   435
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   436
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   437
	 * zs_leafs_with_n_entries[n] is the number of leafs with
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   438
	 * [n*5, (n+1)*5) entries.  In the current implementation, there
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   439
	 * can be at most 55 entries in any block, but there may be
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   440
	 * fewer if the name or value is large, or the block is not
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   441
	 * completely full.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   442
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   443
	uint64_t zs_blocks_with_n5_entries[ZAP_HISTOGRAM_SIZE];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   444
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   445
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   446
	 * zs_leafs_n_tenths_full[n] is the number of leafs whose
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   447
	 * fullness is in the range [n/10, (n+1)/10).
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   448
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   449
	uint64_t zs_blocks_n_tenths_full[ZAP_HISTOGRAM_SIZE];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   450
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   451
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   452
	 * zs_entries_using_n_chunks[n] is the number of entries which
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   453
	 * consume n 24-byte chunks.  (Note, large names/values only use
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   454
	 * one chunk, but contribute to zs_num_blocks_large.)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   455
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   456
	uint64_t zs_entries_using_n_chunks[ZAP_HISTOGRAM_SIZE];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   457
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   458
	/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   459
	 * zs_buckets_with_n_entries[n] is the number of buckets (each
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   460
	 * leaf has 64 buckets) with n entries.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   461
	 * zs_buckets_with_n_entries[1] should be very close to
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   462
	 * zs_num_entries.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   463
	 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   464
	uint64_t zs_buckets_with_n_entries[ZAP_HISTOGRAM_SIZE];
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   465
} zap_stats_t;
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   466
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   467
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   468
 * Get statistics about a ZAP object.  Note: you need to be aware of the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   469
 * internal implementation of the ZAP to correctly interpret some of the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   470
 * statistics.  This interface shouldn't be relied on unless you really
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   471
 * know what you're doing.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   472
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   473
int zap_get_stats(objset_t *ds, uint64_t zapobj, zap_stats_t *zs);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   474
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   475
#ifdef	__cplusplus
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   476
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   477
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   478
1632
7d486ebd46b7 6392291 zdb needs to tell the entire goodness of the fat zap
nd150628
parents: 1578
diff changeset
   479
#endif	/* _SYS_ZAP_H */