Skip to content
Permalink
Browse files

4369 implement zfs bookmarks

4368 zfs send filesystems from readonly pools
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
  • Loading branch information...
ahrens authored and Christopher Siden committed Dec 11, 2013
1 parent 973c78e commit 78f171005391b928aaf1642b3206c534ed644332
Showing with 1,676 additions and 272 deletions.
  1. +7 −1 usr/src/cmd/truss/codes.c
  2. +11 −5 usr/src/cmd/zfs/zfs_iter.c
  3. +259 −61 usr/src/cmd/zfs/zfs_main.c
  4. +9 −0 usr/src/common/zfs/zfeature_common.c
  5. +1 −0 usr/src/common/zfs/zfeature_common.h
  6. +25 −31 usr/src/common/zfs/zfs_deleg.c
  7. +2 −0 usr/src/common/zfs/zfs_deleg.h
  8. +5 −2 usr/src/common/zfs/zfs_namecheck.c
  9. +4 −1 usr/src/common/zfs/zfs_namecheck.h
  10. +7 −6 usr/src/common/zfs/zfs_prop.c
  11. +5 −1 usr/src/lib/libzfs/common/libzfs.h
  12. +113 −33 usr/src/lib/libzfs/common/libzfs_dataset.c
  13. +3 −1 usr/src/lib/libzfs/common/libzfs_impl.h
  14. +58 −4 usr/src/lib/libzfs/common/libzfs_iter.c
  15. +55 −1 usr/src/lib/libzfs/common/libzfs_sendrecv.c
  16. +5 −1 usr/src/lib/libzfs/common/mapfile-vers
  17. +110 −4 usr/src/lib/libzfs_core/common/libzfs_core.c
  18. +16 −16 usr/src/lib/libzfs_core/common/libzfs_core.h
  19. +3 −0 usr/src/lib/libzfs_core/common/mapfile-vers
  20. +2 −0 usr/src/lib/pyzfs/common/allow.py
  21. +97 −19 usr/src/man/man1m/zfs.1m
  22. +26 −5 usr/src/man/man5/zpool-features.5
  23. +1 −1 usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
  24. +1 −0 usr/src/uts/common/Makefile.files
  25. +1 −1 usr/src/uts/common/fs/zfs/dmu_diff.c
  26. +91 −35 usr/src/uts/common/fs/zfs/dmu_send.c
  27. +454 −0 usr/src/uts/common/fs/zfs/dsl_bookmark.c
  28. +42 −4 usr/src/uts/common/fs/zfs/dsl_dataset.c
  29. +6 −0 usr/src/uts/common/fs/zfs/dsl_destroy.c
  30. +1 −1 usr/src/uts/common/fs/zfs/spa_misc.c
  31. +51 −0 usr/src/uts/common/fs/zfs/sys/dsl_bookmark.h
  32. +11 −1 usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
  33. +2 −1 usr/src/uts/common/fs/zfs/sys/dsl_deleg.h
  34. +2 −2 usr/src/uts/common/fs/zfs/zfs_ctldir.c
  35. +182 −30 usr/src/uts/common/fs/zfs/zfs_ioctl.c
  36. +8 −4 usr/src/uts/common/sys/fs/zfs.h
@@ -21,7 +21,7 @@

/*
* Copyright (c) 1989, 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 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
@@ -1268,6 +1268,12 @@ const struct ioc {
"zfs_cmd_t" },
{ (uint_t)ZFS_IOC_CLONE, "ZFS_IOC_CLONE",
"zfs_cmd_t" },
{ (uint_t)ZFS_IOC_BOOKMARK, "ZFS_IOC_BOOKMARK",
"zfs_cmd_t" },
{ (uint_t)ZFS_IOC_GET_BOOKMARKS, "ZFS_IOC_GET_BOOKMARKS",
"zfs_cmd_t" },
{ (uint_t)ZFS_IOC_DESTROY_BOOKMARKS, "ZFS_IOC_DESTROY_BOOKMARKS",
"zfs_cmd_t" },

/* kssl ioctls */
{ (uint_t)KSSL_ADD_ENTRY, "KSSL_ADD_ENTRY",
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
*/

#include <libintl.h>
@@ -70,7 +71,7 @@ uu_avl_pool_t *avl_pool;
* Include snaps if they were requested or if this a zfs list where types
* were not specified and the "listsnapshots" property is set on this pool.
*/
static int
static boolean_t
zfs_include_snapshots(zfs_handle_t *zhp, callback_data_t *cb)
{
zpool_handle_t *zph;
@@ -90,8 +91,9 @@ static int
zfs_callback(zfs_handle_t *zhp, void *data)
{
callback_data_t *cb = data;
int dontclose = 0;
int include_snaps = zfs_include_snapshots(zhp, cb);
boolean_t dontclose = B_FALSE;
boolean_t include_snaps = zfs_include_snapshots(zhp, cb);
boolean_t include_bmarks = (cb->cb_types & ZFS_TYPE_BOOKMARK);

if ((zfs_get_type(zhp) & cb->cb_types) ||
((zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) && include_snaps)) {
@@ -117,7 +119,7 @@ zfs_callback(zfs_handle_t *zhp, void *data)
}
}
uu_avl_insert(cb->cb_avl, node, idx);
dontclose = 1;
dontclose = B_TRUE;
} else {
free(node);
}
@@ -132,8 +134,12 @@ zfs_callback(zfs_handle_t *zhp, void *data)
cb->cb_depth++;
if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM)
(void) zfs_iter_filesystems(zhp, zfs_callback, data);
if ((zfs_get_type(zhp) != ZFS_TYPE_SNAPSHOT) && include_snaps)
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
ZFS_TYPE_BOOKMARK)) == 0) && include_snaps)
(void) zfs_iter_snapshots(zhp, zfs_callback, data);
if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
ZFS_TYPE_BOOKMARK)) == 0) && include_bmarks)
(void) zfs_iter_bookmarks(zhp, zfs_callback, data);
cb->cb_depth--;
}

0 comments on commit 78f1710

Please sign in to comment.
You can’t perform that action at this time.