Print this page
OS-1566 filesystem limits for ZFS datasets
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/common/zfs/zfs_prop.h
+++ new/usr/src/common/zfs/zfs_prop.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 25 */
26 26
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
27 27 #ifndef _ZFS_PROP_H
28 28 #define _ZFS_PROP_H
29 29
30 30 #include <sys/fs/zfs.h>
31 31 #include <sys/types.h>
32 32
33 33 #ifdef __cplusplus
34 34 extern "C" {
35 35 #endif
36 36
37 +#define MAXLIMIT ((uint64_t)-1)
38 +
37 39 /*
38 40 * For index types (e.g. compression and checksum), we want the numeric value
39 41 * in the kernel, but the string value in userland.
40 42 */
41 43 typedef enum {
42 44 PROP_TYPE_NUMBER, /* numeric value */
43 45 PROP_TYPE_STRING, /* string value */
44 46 PROP_TYPE_INDEX /* numeric value indexed by string */
45 47 } zprop_type_t;
46 48
47 49 typedef enum {
48 50 PROP_DEFAULT,
49 51 PROP_READONLY,
50 52 PROP_INHERIT,
51 53 /*
52 54 * ONETIME properties are a sort of conglomeration of READONLY
53 55 * and INHERIT. They can be set only during object creation,
54 56 * after that they are READONLY. If not explicitly set during
55 57 * creation, they can be inherited.
56 58 */
57 59 PROP_ONETIME
58 60 } zprop_attr_t;
59 61
60 62 typedef struct zfs_index {
61 63 const char *pi_name;
62 64 uint64_t pi_value;
63 65 } zprop_index_t;
64 66
65 67 typedef struct {
66 68 const char *pd_name; /* human-readable property name */
67 69 int pd_propnum; /* property number */
68 70 zprop_type_t pd_proptype; /* string, boolean, index, number */
69 71 const char *pd_strdefault; /* default for strings */
70 72 uint64_t pd_numdefault; /* for boolean / index / number */
71 73 zprop_attr_t pd_attr; /* default, readonly, inherit */
72 74 int pd_types; /* bitfield of valid dataset types */
73 75 /* fs | vol | snap; or pool */
74 76 const char *pd_values; /* string telling acceptable values */
75 77 const char *pd_colname; /* column header for "zfs list" */
76 78 boolean_t pd_rightalign; /* column alignment for "zfs list" */
77 79 boolean_t pd_visible; /* do we list this property with the */
78 80 /* "zfs get" help message */
79 81 const zprop_index_t *pd_table; /* for index properties, a table */
80 82 /* defining the possible values */
81 83 size_t pd_table_size; /* number of entries in pd_table[] */
82 84 } zprop_desc_t;
83 85
84 86 /*
85 87 * zfs dataset property functions
86 88 */
87 89 void zfs_prop_init(void);
88 90 zprop_type_t zfs_prop_get_type(zfs_prop_t);
89 91 boolean_t zfs_prop_delegatable(zfs_prop_t prop);
90 92 boolean_t zfs_prop_cacheable(zfs_prop_t prop);
91 93 zprop_desc_t *zfs_prop_get_table(void);
92 94
93 95 /*
94 96 * zpool property functions
95 97 */
96 98 void zpool_prop_init(void);
97 99 zprop_type_t zpool_prop_get_type(zpool_prop_t);
98 100 zprop_desc_t *zpool_prop_get_table(void);
99 101
100 102 /*
101 103 * Common routines to initialize property tables
102 104 */
103 105 void zprop_register_impl(int, const char *, zprop_type_t, uint64_t,
104 106 const char *, zprop_attr_t, int, const char *, const char *,
105 107 boolean_t, boolean_t, const zprop_index_t *);
106 108 void zprop_register_string(int, const char *, const char *,
107 109 zprop_attr_t attr, int, const char *, const char *);
108 110 void zprop_register_number(int, const char *, uint64_t, zprop_attr_t, int,
109 111 const char *, const char *);
110 112 void zprop_register_index(int, const char *, uint64_t, zprop_attr_t, int,
111 113 const char *, const char *, const zprop_index_t *);
112 114 void zprop_register_hidden(int, const char *, zprop_type_t, zprop_attr_t,
113 115 int, const char *);
114 116
115 117 /*
116 118 * Common routines for zfs and zpool property management
117 119 */
118 120 int zprop_iter_common(zprop_func, void *, boolean_t, boolean_t, zfs_type_t);
119 121 int zprop_name_to_prop(const char *, zfs_type_t);
120 122 int zprop_string_to_index(int, const char *, uint64_t *, zfs_type_t);
121 123 int zprop_index_to_string(int, uint64_t, const char **, zfs_type_t);
122 124 uint64_t zprop_random_value(int, uint64_t, zfs_type_t);
123 125 const char *zprop_values(int, zfs_type_t);
124 126 size_t zprop_width(int, boolean_t *, zfs_type_t);
125 127 boolean_t zprop_valid_for_type(int, zfs_type_t);
126 128
127 129 #ifdef __cplusplus
128 130 }
129 131 #endif
130 132
131 133 #endif /* _ZFS_PROP_H */
↓ open down ↓ |
85 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX