diff options
author | delphij <delphij@FreeBSD.org> | 2013-06-12 07:07:06 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2013-06-12 07:07:06 +0000 |
commit | ab3dbcb998b288fc8190c5c1f56d91720e535286 (patch) | |
tree | 82a807ab86be2fa57fe72fbd606665c2c02dd664 /cddl/contrib/opensolaris/lib/libzfs_core | |
parent | cba1418efedac7ba586dbc2591b16cb3cb7e9c66 (diff) | |
download | FreeBSD-src-ab3dbcb998b288fc8190c5c1f56d91720e535286.zip FreeBSD-src-ab3dbcb998b288fc8190c5c1f56d91720e535286.tar.gz |
MFV r251644:
Poor ZFS send / receive performance due to snapshot
hold / release processing (by smh@)
Illumos ZFS issues:
3740 Poor ZFS send / receive performance due to snapshot
hold / release processing
MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs_core')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c index ab23aa1..31d5fd5 100644 --- a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c +++ b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -301,8 +302,11 @@ lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist) * marked for deferred destruction, and will be destroyed when the last hold * or clone is removed/destroyed. * + * The return value will be ENOENT if none of the snapshots existed. + * * The return value will be 0 if all snapshots were destroyed (or marked for - * later destruction if 'defer' is set) or didn't exist to begin with. + * later destruction if 'defer' is set) or didn't exist to begin with and + * at least one snapshot was destroyed. * * Otherwise the return value will be the errno of a (unspecified) snapshot * that failed, no snapshots will be destroyed, and the errlist will have an @@ -333,7 +337,6 @@ lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist) nvlist_free(args); return (error); - } int @@ -393,11 +396,22 @@ lzc_exists(const char *dataset) * uncleanly, the holds will be released when the pool is next opened * or imported. * - * The return value will be 0 if all holds were created. Otherwise the return - * value will be the errno of a (unspecified) hold that failed, no holds will - * be created, and the errlist will have an entry for each hold that - * failed (name = snapshot). The value in the errlist will be the error - * code (int32). + * Holds for snapshots which don't exist will be skipped and have an entry + * added to errlist, but will not cause an overall failure, except in the + * case that all holds where skipped. + * + * The return value will be ENOENT if none of the snapshots for the requested + * holds existed. + * + * The return value will be 0 if the nvl holds was empty or all holds, for + * snapshots that existed, were succesfully created and at least one hold + * was created. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed and no holds will be created. + * + * In all cases the errlist will have an entry for each hold that failed + * (name = snapshot), with its value being the error code (int32). */ int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) @@ -434,11 +448,20 @@ lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) * The snapshots must all be in the same pool. * The value is a nvlist whose keys are the holds to remove. * - * The return value will be 0 if all holds were removed. - * Otherwise the return value will be the errno of a (unspecified) release - * that failed, no holds will be released, and the errlist will have an - * entry for each snapshot that has failed releases (name = snapshot). - * The value in the errlist will be the error code (int32) of a failed release. + * Holds which failed to release because they didn't exist will have an entry + * added to errlist, but will not cause an overall failure, except in the + * case that all releases where skipped. + * + * The return value will be ENOENT if none of the specified holds existed. + * + * The return value will be 0 if the nvl holds was empty or all holds that + * existed, were successfully removed and at least one hold was removed. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed to release and no holds will be released. + * + * In all cases the errlist will have an entry for each hold that failed to + * to release. */ int lzc_release(nvlist_t *holds, nvlist_t **errlist) |