Path: blob/main/sys/contrib/openzfs/include/zfs_deleg.h
48254 views
// SPDX-License-Identifier: CDDL-1.01/*2* CDDL HEADER START3*4* The contents of this file are subject to the terms of the5* Common Development and Distribution License (the "License").6* You may not use this file except in compliance with the License.7*8* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE9* or https://opensource.org/licenses/CDDL-1.0.10* See the License for the specific language governing permissions11* and limitations under the License.12*13* When distributing Covered Code, include this CDDL HEADER in each14* file and include the License file at usr/src/OPENSOLARIS.LICENSE.15* If applicable, add the following below this CDDL HEADER, with the16* fields enclosed by brackets "[]" replaced with your own identifying17* information: Portions Copyright [yyyy] [name of copyright owner]18*19* CDDL HEADER END20*/21/*22* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.23* Copyright 2010 Nexenta Systems, Inc. All rights reserved.24* Copyright (c) 2013, 2015 by Delphix. All rights reserved.25*/2627#ifndef _ZFS_DELEG_H28#define _ZFS_DELEG_H extern __attribute__((visibility("default")))2930#include <sys/fs/zfs.h>3132#ifdef __cplusplus33extern "C" {34#endif3536#define ZFS_DELEG_SET_NAME_CHR '@' /* set name lead char */37#define ZFS_DELEG_FIELD_SEP_CHR '$' /* field separator */3839/*40* Max name length for a delegation attribute41*/42#define ZFS_MAX_DELEG_NAME 1284344#define ZFS_DELEG_LOCAL 'l'45#define ZFS_DELEG_DESCENDENT 'd'46#define ZFS_DELEG_NA '-'4748typedef enum {49ZFS_DELEG_NOTE_CREATE,50ZFS_DELEG_NOTE_DESTROY,51ZFS_DELEG_NOTE_SNAPSHOT,52ZFS_DELEG_NOTE_ROLLBACK,53ZFS_DELEG_NOTE_CLONE,54ZFS_DELEG_NOTE_PROMOTE,55ZFS_DELEG_NOTE_RENAME,56ZFS_DELEG_NOTE_SEND,57ZFS_DELEG_NOTE_SEND_RAW,58ZFS_DELEG_NOTE_RECEIVE,59ZFS_DELEG_NOTE_ALLOW,60ZFS_DELEG_NOTE_USERPROP,61ZFS_DELEG_NOTE_MOUNT,62ZFS_DELEG_NOTE_SHARE,63ZFS_DELEG_NOTE_USERQUOTA,64ZFS_DELEG_NOTE_GROUPQUOTA,65ZFS_DELEG_NOTE_USERUSED,66ZFS_DELEG_NOTE_GROUPUSED,67ZFS_DELEG_NOTE_USEROBJQUOTA,68ZFS_DELEG_NOTE_GROUPOBJQUOTA,69ZFS_DELEG_NOTE_USEROBJUSED,70ZFS_DELEG_NOTE_GROUPOBJUSED,71ZFS_DELEG_NOTE_HOLD,72ZFS_DELEG_NOTE_RELEASE,73ZFS_DELEG_NOTE_DIFF,74ZFS_DELEG_NOTE_BOOKMARK,75ZFS_DELEG_NOTE_LOAD_KEY,76ZFS_DELEG_NOTE_CHANGE_KEY,77ZFS_DELEG_NOTE_PROJECTUSED,78ZFS_DELEG_NOTE_PROJECTQUOTA,79ZFS_DELEG_NOTE_PROJECTOBJUSED,80ZFS_DELEG_NOTE_PROJECTOBJQUOTA,81ZFS_DELEG_NOTE_NONE82} zfs_deleg_note_t;8384typedef struct zfs_deleg_perm_tab {85const char *z_perm;86zfs_deleg_note_t z_note;87} zfs_deleg_perm_tab_t;8889_ZFS_DELEG_H const zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];9091_ZFS_DELEG_H int zfs_deleg_verify_nvlist(nvlist_t *nvlist);92_ZFS_DELEG_H void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,93char checkflag, void *data);94_ZFS_DELEG_H const char *zfs_deleg_canonicalize_perm(const char *perm);9596#ifdef __cplusplus97}98#endif99100#endif /* _ZFS_DELEG_H */101102103