diff options
Diffstat (limited to 'usr/src/cmd/ndmpd/tlm/tlm_lib.c')
-rw-r--r-- | usr/src/cmd/ndmpd/tlm/tlm_lib.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/usr/src/cmd/ndmpd/tlm/tlm_lib.c b/usr/src/cmd/ndmpd/tlm/tlm_lib.c index 14801cb75e..ec9ee5f225 100644 --- a/usr/src/cmd/ndmpd/tlm/tlm_lib.c +++ b/usr/src/cmd/ndmpd/tlm/tlm_lib.c @@ -1170,111 +1170,6 @@ tlm_ioctl(int fd, int cmd, void *data) */ /* - * Create a snapshot on the volume - */ -int -chkpnt_backup_prepare(char *volname, char *jname, boolean_t recursive) -{ - char chk_name[PATH_MAX]; - char *p; - int rv; - - if (!volname || !*volname) - return (-1); - - /* Should also return -1 if checkpoint not enabled */ - - /* Remove the leading slash */ - p = volname; - while (*p == '/') - p++; - - (void) snprintf(chk_name, PATH_MAX, "%s@%s", p, jname); - - (void) mutex_lock(&zlib_mtx); - if ((rv = zfs_snapshot(zlibh, chk_name, recursive, NULL)) - == -1) { - if (errno == EEXIST) { - (void) mutex_unlock(&zlib_mtx); - return (0); - } - NDMP_LOG(LOG_DEBUG, - "chkpnt_backup_prepare: %s failed (err=%d): %s", - chk_name, errno, libzfs_error_description(zlibh)); - (void) mutex_unlock(&zlib_mtx); - return (rv); - } - (void) mutex_unlock(&zlib_mtx); - return (0); -} - -/* - * Remove the 'backup' snapshot if backup was successful - */ -int -chkpnt_backup_successful(char *volname, char *jname, boolean_t recursive, - int *zfs_err) -{ - char chk_name[PATH_MAX]; - zfs_handle_t *zhp; - zfs_type_t ztype; - int err; - char *p; - - if (zfs_err) - *zfs_err = 0; - - if (!volname || !*volname) - return (-1); - - /* Should also return -1 if checkpoint not enabled */ - - /* Remove the leading slash */ - p = volname; - while (*p == '/') - p++; - - if (recursive) { - ztype = ZFS_TYPE_VOLUME | ZFS_TYPE_FILESYSTEM; - } else { - (void) snprintf(chk_name, PATH_MAX, "%s@%s", p, jname); - p = chk_name; - ztype = ZFS_TYPE_SNAPSHOT; - } - - (void) mutex_lock(&zlib_mtx); - if ((zhp = zfs_open(zlibh, p, ztype)) == NULL) { - NDMP_LOG(LOG_DEBUG, "chkpnt_backup_successful: open %s failed", - p); - (void) mutex_unlock(&zlib_mtx); - return (-1); - } - - if (recursive) { - err = zfs_destroy_snaps(zhp, jname, B_TRUE); - } else { - err = zfs_destroy(zhp, B_TRUE); - } - - if (err) { - NDMP_LOG(LOG_ERR, "%s (recursive destroy: %d): %d; %s; %s", - p, - recursive, - libzfs_errno(zlibh), - libzfs_error_action(zlibh), - libzfs_error_description(zlibh)); - - if (zfs_err) - *zfs_err = err; - } - - zfs_close(zhp); - (void) mutex_unlock(&zlib_mtx); - - return (0); -} - -/* * Get the snapshot creation time */ int |