diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2017-09-22 08:18:05 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2017-09-22 08:18:05 +0000 |
commit | a373b4201a9710f0aafcf47bad82450448074c16 (patch) | |
tree | 02d789baaa84f69b813ac8b7ed2dfd125a283131 /lib | |
parent | 52aa70fa5950b5223b0797daf37baeca9efc8131 (diff) | |
download | src-a373b4201a9710f0aafcf47bad82450448074c16.tar.gz src-a373b4201a9710f0aafcf47bad82450448074c16.zip |
8600 ZFS channel programs - snapshot
illumos/illumos-gate@2840dce1a029098fb784afd951d5f98089f850d8
https://github.com/illumos/illumos-gate/commit/2840dce1a029098fb784afd951d5f98089f850d8
https://www.illumos.org/issues/8600
ZFS channel programs should be able to create snapshots.
In addition to the base snapshot functionality, this will likely entail adding
extra logic to handle edge cases which were formerly not possible, such as
creating then destroying a snapshot in the same transaction sync.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>
Notes
Notes:
svn path=/vendor-sys/illumos/dist/; revision=323913
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs_core/common/libzfs_core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libzfs_core/common/libzfs_core.c b/lib/libzfs_core/common/libzfs_core.c index c17ebcc58ded..d3e92151f76f 100644 --- a/lib/libzfs_core/common/libzfs_core.c +++ b/lib/libzfs_core/common/libzfs_core.c @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. @@ -142,7 +142,12 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, if (resultp != NULL) { *resultp = NULL; - zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + if (ioc == ZFS_IOC_CHANNEL_PROGRAM) { + zc.zc_nvlist_dst_size = fnvlist_lookup_uint64(source, + ZCP_ARG_MEMLIMIT); + } else { + zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + } zc.zc_nvlist_dst = (uint64_t)(uintptr_t) malloc(zc.zc_nvlist_dst_size); if (zc.zc_nvlist_dst == NULL) { @@ -156,7 +161,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, * If ioctl exited with ENOMEM, we retry the ioctl after * increasing the size of the destination nvlist. * - * Channel programs that exit with ENOMEM probably ran over the + * Channel programs that exit with ENOMEM ran over the * lua memory sandbox; they should not be retried. */ if (errno == ENOMEM && resultp != NULL && |