/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include "shadow_impl.h"
/*
* Removes an entire directory tree. This should really be using openat() and
* friends, but there is (annoyingly) no rmdirat().
*/
static void
{
return;
continue;
}
}
} else {
}
}
/*
* Cancel any current shadow migration. This involves clearing the shadow
* mount option, clearing the ZFS shadow property if a ZFS dataset, and
* removing the global extended attributes associated with the migration.
*/
int
{
/*
* Disable shadow migration. If this is a ZFS dataset, then we clear
* the corresponding ZFS property, which will tear down the underlying
* mount. If this is a regular filesystem, then we just do a remount
* without the corresponding mount option.
*/
(void) shadow_error(ESHADOW_ZFS_NOENT,
return (-1);
}
ZFS_TYPE_FILESYSTEM)) == NULL) {
(void) shadow_zfs_error(zhdl);
return (-1);
}
"none") != 0) {
(void) shadow_zfs_error(zhdl);
return (-1);
}
} else {
return (shadow_error(ESHADOW_MNT_CLEAR,
"failed to clear shadow mount option: %s",
}
}
/*
* Now that the shadow setting has been cleared, go through the private
* .SUNWshadow directory and remove any internal data. If this fails
* for any reason, we ignore it and drive on, as there is no way to
* resume the migration, and the filesystem data itself is intact.
*/
return (0);
}