xref: /illumos-gate/usr/src/cmd/zfs/zfs_projectutil.h (revision f67950b2)
1*f67950b2SNasf-Fan /*
2*f67950b2SNasf-Fan  * CDDL HEADER START
3*f67950b2SNasf-Fan  *
4*f67950b2SNasf-Fan  * The contents of this file are subject to the terms of the
5*f67950b2SNasf-Fan  * Common Development and Distribution License (the "License").
6*f67950b2SNasf-Fan  * You may not use this file except in compliance with the License.
7*f67950b2SNasf-Fan  *
8*f67950b2SNasf-Fan  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*f67950b2SNasf-Fan  * or http://www.opensolaris.org/os/licensing.
10*f67950b2SNasf-Fan  * See the License for the specific language governing permissions
11*f67950b2SNasf-Fan  * and limitations under the License.
12*f67950b2SNasf-Fan  *
13*f67950b2SNasf-Fan  * When distributing Covered Code, include this CDDL HEADER in each
14*f67950b2SNasf-Fan  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*f67950b2SNasf-Fan  * If applicable, add the following below this CDDL HEADER, with the
16*f67950b2SNasf-Fan  * fields enclosed by brackets "[]" replaced with your own identifying
17*f67950b2SNasf-Fan  * information: Portions Copyright [yyyy] [name of copyright owner]
18*f67950b2SNasf-Fan  *
19*f67950b2SNasf-Fan  * CDDL HEADER END
20*f67950b2SNasf-Fan  */
21*f67950b2SNasf-Fan /*
22*f67950b2SNasf-Fan  * Copyright (c) 2017, Intel Corporation. All rights reserved.
23*f67950b2SNasf-Fan  */
24*f67950b2SNasf-Fan 
25*f67950b2SNasf-Fan #ifndef	_ZFS_PROJECTUTIL_H
26*f67950b2SNasf-Fan #define	_ZFS_PROJECTUTIL_H
27*f67950b2SNasf-Fan 
28*f67950b2SNasf-Fan typedef enum {
29*f67950b2SNasf-Fan 	ZFS_PROJECT_OP_DEFAULT	= 0,
30*f67950b2SNasf-Fan 	ZFS_PROJECT_OP_LIST	= 1,
31*f67950b2SNasf-Fan 	ZFS_PROJECT_OP_CHECK	= 2,
32*f67950b2SNasf-Fan 	ZFS_PROJECT_OP_CLEAR	= 3,
33*f67950b2SNasf-Fan 	ZFS_PROJECT_OP_SET	= 4,
34*f67950b2SNasf-Fan } zfs_project_ops_t;
35*f67950b2SNasf-Fan 
36*f67950b2SNasf-Fan typedef struct zfs_project_control {
37*f67950b2SNasf-Fan 	uint64_t		zpc_expected_projid;
38*f67950b2SNasf-Fan 	zfs_project_ops_t	zpc_op;
39*f67950b2SNasf-Fan 	boolean_t		zpc_dironly;
40*f67950b2SNasf-Fan 	boolean_t		zpc_ignore_noent;
41*f67950b2SNasf-Fan 	boolean_t		zpc_keep_projid;
42*f67950b2SNasf-Fan 	boolean_t		zpc_newline;
43*f67950b2SNasf-Fan 	boolean_t		zpc_recursive;
44*f67950b2SNasf-Fan 	boolean_t		zpc_set_flag;
45*f67950b2SNasf-Fan } zfs_project_control_t;
46*f67950b2SNasf-Fan 
47*f67950b2SNasf-Fan int zfs_project_handle(const char *name, zfs_project_control_t *zpc);
48*f67950b2SNasf-Fan 
49*f67950b2SNasf-Fan #endif	/* _ZFS_PROJECTUTIL_H */
50