xref: /titanic_52/usr/src/common/zfs/zfs_prop.h (revision e9dbad6f263d5570ed7ff5443ec5b958af8c24d7)
1fa9e4066Sahrens /*
2fa9e4066Sahrens  * CDDL HEADER START
3fa9e4066Sahrens  *
4fa9e4066Sahrens  * The contents of this file are subject to the terms of the
5*e9dbad6fSeschrock  * Common Development and Distribution License (the "License").
6*e9dbad6fSeschrock  * You may not use this file except in compliance with the License.
7fa9e4066Sahrens  *
8fa9e4066Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fa9e4066Sahrens  * or http://www.opensolaris.org/os/licensing.
10fa9e4066Sahrens  * See the License for the specific language governing permissions
11fa9e4066Sahrens  * and limitations under the License.
12fa9e4066Sahrens  *
13fa9e4066Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14fa9e4066Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fa9e4066Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16fa9e4066Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17fa9e4066Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18fa9e4066Sahrens  *
19fa9e4066Sahrens  * CDDL HEADER END
20fa9e4066Sahrens  */
21fa9e4066Sahrens /*
22*e9dbad6fSeschrock  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23fa9e4066Sahrens  * Use is subject to license terms.
24fa9e4066Sahrens  */
25fa9e4066Sahrens 
26fa9e4066Sahrens #ifndef	_ZFS_PROP_H
27fa9e4066Sahrens #define	_ZFS_PROP_H
28fa9e4066Sahrens 
29fa9e4066Sahrens #pragma ident	"%Z%%M%	%I%	%E% SMI"
30fa9e4066Sahrens 
31fa9e4066Sahrens #include <sys/fs/zfs.h>
32fa9e4066Sahrens #include <sys/types.h>
33fa9e4066Sahrens 
34fa9e4066Sahrens #ifdef	__cplusplus
35fa9e4066Sahrens extern "C" {
36fa9e4066Sahrens #endif
37fa9e4066Sahrens 
38101f5531Slling /*
39101f5531Slling  * For index types (e.g. compression and checksum), we want the numeric value
40101f5531Slling  * in the kernel, but the string value in userland.
41101f5531Slling  */
42fa9e4066Sahrens typedef enum {
43fa9e4066Sahrens 	prop_type_number,	/* numeric value */
44fa9e4066Sahrens 	prop_type_string,	/* string value */
45fa9e4066Sahrens 	prop_type_boolean,	/* boolean value */
46fa9e4066Sahrens 	prop_type_index		/* numeric value indexed by string */
47fa9e4066Sahrens } zfs_proptype_t;
48fa9e4066Sahrens 
49fa9e4066Sahrens zfs_proptype_t zfs_prop_get_type(zfs_prop_t);
50*e9dbad6fSeschrock int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *);
51*e9dbad6fSeschrock int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **);
52*e9dbad6fSeschrock size_t zfs_prop_width(zfs_prop_t, boolean_t *);
53fa9e4066Sahrens 
54fa9e4066Sahrens #ifdef	__cplusplus
55fa9e4066Sahrens }
56fa9e4066Sahrens #endif
57fa9e4066Sahrens 
58fa9e4066Sahrens #endif	/* _ZFS_PROP_H */
59