diff options
author | Matthew Ahrens <[email protected]> | 2013-12-11 14:33:41 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-07-29 10:55:29 -0700 |
commit | da536844d55b2f3aaefdaebd36fb97bb867494aa (patch) | |
tree | 2b0b5bbad2595189476a8084e24f26e6106bbb4d /module/zcommon | |
parent | b0bc7a84d90dcbf5321d48c5b24ed771c5a128b0 (diff) |
Illumos 4368, 4369.
4369 implement zfs bookmarks
4368 zfs send filesystems from readonly pools
Reviewed by: Christopher Siden <[email protected]>
Reviewed by: George Wilson <[email protected]>
Approved by: Garrett D'Amore <[email protected]>
References:
https://www.illumos.org/issues/4369
https://www.illumos.org/issues/4368
https://github.com/illumos/illumos-gate/commit/78f1710
Ported by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2530
Diffstat (limited to 'module/zcommon')
-rw-r--r-- | module/zcommon/zfs_deleg.c | 56 | ||||
-rw-r--r-- | module/zcommon/zfs_namecheck.c | 9 | ||||
-rw-r--r-- | module/zcommon/zfs_prop.c | 13 |
3 files changed, 38 insertions, 40 deletions
diff --git a/module/zcommon/zfs_deleg.c b/module/zcommon/zfs_deleg.c index 9de61790c..a152b4e76 100644 --- a/module/zcommon/zfs_deleg.c +++ b/module/zcommon/zfs_deleg.c @@ -21,8 +21,11 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ +#include <sys/zfs_context.h> + #if defined(_KERNEL) #include <sys/systm.h> #include <sys/sunddi.h> @@ -34,43 +37,34 @@ #include <libnvpair.h> #include <ctype.h> #endif -/* XXX includes zfs_context.h, so why bother with the above? */ #include <sys/dsl_deleg.h> #include "zfs_prop.h" #include "zfs_deleg.h" #include "zfs_namecheck.h" -/* - * permission table - * - * Keep this table in sorted order - * - * This table is used for displaying all permissions for - * zfs allow - */ - zfs_deleg_perm_tab_t zfs_deleg_perm_tab[] = { - {ZFS_DELEG_PERM_ALLOW, ZFS_DELEG_NOTE_ALLOW}, - {ZFS_DELEG_PERM_CLONE, ZFS_DELEG_NOTE_CLONE }, - {ZFS_DELEG_PERM_CREATE, ZFS_DELEG_NOTE_CREATE }, - {ZFS_DELEG_PERM_DESTROY, ZFS_DELEG_NOTE_DESTROY }, - {ZFS_DELEG_PERM_MOUNT, ZFS_DELEG_NOTE_MOUNT }, - {ZFS_DELEG_PERM_PROMOTE, ZFS_DELEG_NOTE_PROMOTE }, - {ZFS_DELEG_PERM_RECEIVE, ZFS_DELEG_NOTE_RECEIVE }, - {ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME }, - {ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK }, - {ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT }, - {ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE }, - {ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND }, - {ZFS_DELEG_PERM_USERPROP, ZFS_DELEG_NOTE_USERPROP }, - {ZFS_DELEG_PERM_USERQUOTA, ZFS_DELEG_NOTE_USERQUOTA }, - {ZFS_DELEG_PERM_GROUPQUOTA, ZFS_DELEG_NOTE_GROUPQUOTA }, - {ZFS_DELEG_PERM_USERUSED, ZFS_DELEG_NOTE_USERUSED }, - {ZFS_DELEG_PERM_GROUPUSED, ZFS_DELEG_NOTE_GROUPUSED }, - {ZFS_DELEG_PERM_HOLD, ZFS_DELEG_NOTE_HOLD }, - {ZFS_DELEG_PERM_RELEASE, ZFS_DELEG_NOTE_RELEASE }, - {ZFS_DELEG_PERM_DIFF, ZFS_DELEG_NOTE_DIFF}, - {NULL, ZFS_DELEG_NOTE_NONE } + {ZFS_DELEG_PERM_ALLOW}, + {ZFS_DELEG_PERM_BOOKMARK}, + {ZFS_DELEG_PERM_CLONE}, + {ZFS_DELEG_PERM_CREATE}, + {ZFS_DELEG_PERM_DESTROY}, + {ZFS_DELEG_PERM_DIFF}, + {ZFS_DELEG_PERM_MOUNT}, + {ZFS_DELEG_PERM_PROMOTE}, + {ZFS_DELEG_PERM_RECEIVE}, + {ZFS_DELEG_PERM_RENAME}, + {ZFS_DELEG_PERM_ROLLBACK}, + {ZFS_DELEG_PERM_SNAPSHOT}, + {ZFS_DELEG_PERM_SHARE}, + {ZFS_DELEG_PERM_SEND}, + {ZFS_DELEG_PERM_USERPROP}, + {ZFS_DELEG_PERM_USERQUOTA}, + {ZFS_DELEG_PERM_GROUPQUOTA}, + {ZFS_DELEG_PERM_USERUSED}, + {ZFS_DELEG_PERM_GROUPUSED}, + {ZFS_DELEG_PERM_HOLD}, + {ZFS_DELEG_PERM_RELEASE}, + {NULL} }; static int diff --git a/module/zcommon/zfs_namecheck.c b/module/zcommon/zfs_namecheck.c index 8508bc734..ff724be58 100644 --- a/module/zcommon/zfs_namecheck.c +++ b/module/zcommon/zfs_namecheck.c @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ /* * Common name validation routines for ZFS. These routines are shared by the @@ -62,7 +65,7 @@ valid_char(char c) * [-_.: ] */ int -snapshot_namecheck(const char *path, namecheck_err_t *why, char *what) +zfs_component_namecheck(const char *path, namecheck_err_t *why, char *what) { const char *loc; @@ -113,7 +116,7 @@ permset_namecheck(const char *path, namecheck_err_t *why, char *what) return (-1); } - return (snapshot_namecheck(&path[1], why, what)); + return (zfs_component_namecheck(&path[1], why, what)); } /* @@ -372,7 +375,7 @@ pool_namecheck(const char *pool, namecheck_err_t *why, char *what) } #if defined(_KERNEL) && defined(HAVE_SPL) -EXPORT_SYMBOL(snapshot_namecheck); EXPORT_SYMBOL(pool_namecheck); EXPORT_SYMBOL(dataset_namecheck); +EXPORT_SYMBOL(zfs_component_namecheck); #endif diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index d81ff3bc6..92cfa282b 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -327,7 +327,8 @@ zfs_prop_init(void) PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | share(1M) options", "SHARENFS"); zprop_register_string(ZFS_PROP_TYPE, "type", NULL, PROP_READONLY, - ZFS_TYPE_DATASET, "filesystem | volume | snapshot", "TYPE"); + ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, + "filesystem | volume | snapshot | bookmark", "TYPE"); zprop_register_string(ZFS_PROP_SHARESMB, "sharesmb", "off", PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | sharemgr(1M) options", "SHARESMB"); @@ -405,18 +406,18 @@ zfs_prop_init(void) /* hidden properties */ zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "CREATETXG"); + PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "CREATETXG"); zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES"); zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING, - PROP_READONLY, ZFS_TYPE_DATASET, "NAME"); + PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "NAME"); zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions", PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS"); zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu", PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "STMF_SBD_LU"); zprop_register_hidden(ZFS_PROP_GUID, "guid", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "GUID"); + PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "GUID"); zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "USERACCOUNTING"); @@ -436,7 +437,7 @@ zfs_prop_init(void) /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, - NULL, PROP_READONLY, ZFS_TYPE_DATASET, + NULL, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<date>", "CREATION", B_FALSE, B_TRUE, NULL); } |