FreeBSD ZFS
The Zettabyte File System

sys/dsl_deleg.h

Go to the documentation of this file.
00001 /*
00002  * CDDL HEADER START
00003  *
00004  * The contents of this file are subject to the terms of the
00005  * Common Development and Distribution License (the "License").
00006  * You may not use this file except in compliance with the License.
00007  *
00008  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
00009  * or http://www.opensolaris.org/os/licensing.
00010  * See the License for the specific language governing permissions
00011  * and limitations under the License.
00012  *
00013  * When distributing Covered Code, include this CDDL HEADER in each
00014  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
00015  * If applicable, add the following below this CDDL HEADER, with the
00016  * fields enclosed by brackets "[]" replaced with your own identifying
00017  * information: Portions Copyright [yyyy] [name of copyright owner]
00018  *
00019  * CDDL HEADER END
00020  */
00021 /*
00022  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
00023  * Copyright (c) 2011 by Delphix. All rights reserved.
00024  */
00025 
00026 #ifndef _SYS_DSL_DELEG_H
00027 #define _SYS_DSL_DELEG_H
00028 
00029 #include <sys/dmu.h>
00030 #include <sys/dsl_pool.h>
00031 #include <sys/zfs_context.h>
00032 
00033 #ifdef  __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 #define ZFS_DELEG_PERM_NONE             ""
00038 #define ZFS_DELEG_PERM_CREATE           "create"
00039 #define ZFS_DELEG_PERM_DESTROY          "destroy"
00040 #define ZFS_DELEG_PERM_SNAPSHOT         "snapshot"
00041 #define ZFS_DELEG_PERM_ROLLBACK         "rollback"
00042 #define ZFS_DELEG_PERM_CLONE            "clone"
00043 #define ZFS_DELEG_PERM_PROMOTE          "promote"
00044 #define ZFS_DELEG_PERM_RENAME           "rename"
00045 #define ZFS_DELEG_PERM_MOUNT            "mount"
00046 #define ZFS_DELEG_PERM_SHARE            "share"
00047 #define ZFS_DELEG_PERM_SEND             "send"
00048 #define ZFS_DELEG_PERM_RECEIVE          "receive"
00049 #define ZFS_DELEG_PERM_ALLOW            "allow"
00050 #define ZFS_DELEG_PERM_USERPROP         "userprop"
00051 #define ZFS_DELEG_PERM_VSCAN            "vscan"
00052 #define ZFS_DELEG_PERM_USERQUOTA        "userquota"
00053 #define ZFS_DELEG_PERM_GROUPQUOTA       "groupquota"
00054 #define ZFS_DELEG_PERM_USERUSED         "userused"
00055 #define ZFS_DELEG_PERM_GROUPUSED        "groupused"
00056 #define ZFS_DELEG_PERM_HOLD             "hold"
00057 #define ZFS_DELEG_PERM_RELEASE          "release"
00058 #define ZFS_DELEG_PERM_DIFF             "diff"
00059 
00060 /*
00061  * Note: the names of properties that are marked delegatable are also
00062  * valid delegated permissions
00063  */
00064 
00065 int dsl_deleg_get(const char *ddname, nvlist_t **nvp);
00066 int dsl_deleg_set(const char *ddname, nvlist_t *nvp, boolean_t unset);
00067 int dsl_deleg_access(const char *ddname, const char *perm, cred_t *cr);
00068 int dsl_deleg_access_impl(struct dsl_dataset *ds, boolean_t descendent,
00069     const char *perm, cred_t *cr);
00070 void dsl_deleg_set_create_perms(dsl_dir_t *dd, dmu_tx_t *tx, cred_t *cr);
00071 int dsl_deleg_can_allow(char *ddname, nvlist_t *nvp, cred_t *cr);
00072 int dsl_deleg_can_unallow(char *ddname, nvlist_t *nvp, cred_t *cr);
00073 int dsl_deleg_destroy(objset_t *os, uint64_t zapobj, dmu_tx_t *tx);
00074 boolean_t dsl_delegation_on(objset_t *os);
00075 
00076 #ifdef  __cplusplus
00077 }
00078 #endif
00079 
00080 #endif  /* _SYS_DSL_DELEG_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines