Lines Matching defs:altroot
232 * Description: Mounts a BE. If the altroot is not provided, this function
235 * altroot reference pointer passed in. This returned value is
240 * altroot - reference pointer to altroot of where to mount BE.
249 _be_mount(char *be_name, char **altroot, int flags)
261 if (be_name == NULL || altroot == NULL)
313 * If altroot not provided, create a temporary alternate root
316 if (*altroot == NULL) {
326 tmp_altroot = *altroot;
329 md.altroot = tmp_altroot;
348 free(md.altroot);
392 * If a NULL altroot was passed in, pass the generated altroot
393 * back to the caller in altroot.
397 *altroot = tmp_altroot;
510 ud.altroot = mountpoint;
599 if (lstat(md->altroot, &buf) != 0) {
600 if (mkdirp(md->altroot, 0755) != 0) {
603 "to create mountpoint %s\n"), md->altroot);
621 if (mount(zfs_get_name(zhp), md->altroot, MS_OVERLAY, MNTTYPE_ZFS,
626 zfs_get_name(zhp), md->altroot);
731 if (!zfs_is_mounted(zhp, &fld->altroot)) {
732 if ((ret = _be_mount(be_name, &fld->altroot,
741 } else if (fld->altroot == NULL) {
743 "get altroot of mounted BE %s: %s\n"),
771 if (!zfs_is_mounted(zhp, &zone_md.altroot)) {
776 "%s%s", fld->altroot, zoneroot);
777 if ((zone_md.altroot = strdup(zone_altroot)) == NULL) {
789 free(zone_md.altroot);
790 zone_md.altroot = NULL;
796 free(fld->altroot);
797 fld->altroot = zone_md.altroot;
804 if (get_mountpoint_from_vfstab(fld->altroot, zfs_get_name(zhp),
831 zone_ud.altroot = fld->altroot;
854 free(fld->altroot);
855 fld->altroot = NULL;
879 free(fld->altroot);
1137 * data - pointer to the altroot of where to mount BE.
1150 char *altroot = data;
1194 if (get_mountpoint_from_vfstab(altroot, fs_name,
1226 "%s%s", altroot, zhp_mountpoint);
1269 altroot)) != 0) {
1360 if ((strncmp(mountpoint, ud->altroot,
1361 strlen(ud->altroot)) == 0) &&
1362 (mountpoint[strlen(ud->altroot)] == '/')) {
1365 strlen(ud->altroot);
1382 "%s not mounted under BE's altroot %s, "
1383 "skipping ...\n"), fs_name, ud->altroot);
1453 if (get_mountpoint_from_vfstab(fld->altroot, fs_name,
1635 * Description: This function loopback mounts a file system into the altroot
1687 md->altroot, zhp_mountpoint);
1697 /* Loopback mount this dataset at the altroot */
1713 * Description: This function loopback mounts a zonepath into the altroot
1752 * before attempting the loopback mount of zonepath under altroot,
1754 * zone path are also mounted under altroot
1794 * loopback mounted under altroot or
1796 * already under altroot if it is in
1802 md->altroot, parentmnt);
1831 md->altroot, zonepath);
1836 /* Loopback mount this dataset at the altroot */
1856 * loopback mount entries that reside within the altroot of
1912 * loopback mount entries mounted under our altroot.
1914 altroot_len = strlen(ud->altroot);
1922 /* If inside the altroot, unmount it */
1923 if (strncmp(entp->mnt_mountp, ud->altroot, altroot_len) == 0 &&
1950 * Description: This function digs into the vfstab in the given altroot,
1954 * it returns the mountpoint with the altroot prepended.
1956 * altroot - pointer to the alternate root location
1958 * vfstab in altroot
1963 * mountpoint should be populated with the altroot
1972 get_mountpoint_from_vfstab(char *altroot, const char *fs, char *mountpoint,
1981 altroot);
1993 * If the flag to prepend the altroot into the mountpoint
1997 (void) snprintf(mountpoint, size_mp, "%s%s", altroot,
2016 * set to be mounted at some specified altroot. If so, fix it by
2017 * removing altroot from the beginning of its mountpoint.
2021 * the altroot we're looking for. In this case, this function
2022 * will errantly remove the altroot portion from the beginning
2027 * data - altroot of where BE is to be mounted.
2041 char *altroot = data;
2065 * under the altroot we're fixing it against.
2067 if (strncmp(mountpoint, altroot, strlen(altroot)) == 0 &&
2068 mountpoint[strlen(altroot)] == '/') {
2072 * altroot.
2074 zhp_mountpoint = mountpoint + strlen(altroot);
2094 altroot)) != 0) {
2107 * specified altroot.
2110 * to be mounted at altroot.
2111 * altroot - location of where to mount the BE root.
2119 be_mount_root(zfs_handle_t *zhp, char *altroot)
2146 if (zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), altroot)
2150 zfs_get_name(zhp), altroot,
2159 altroot, libzfs_error_description(g_zfs));
2199 if (get_mountpoint_from_vfstab(ud->altroot, zfs_get_name(zhp),
2258 char *altroot = NULL;
2298 /* Generate temporary altroot to mount the root file system */
2299 if ((ret = be_make_tmp_mountpoint(&altroot)) != BE_SUCCESS) {
2306 if ((ret = be_mount_root(zhp, altroot)) != BE_SUCCESS) {
2311 ud.altroot = altroot;
2319 free(altroot);
2352 z_set_zone_root(md->altroot);
2392 * mounted under altroot. Otherwise, we need to do
2412 "altroot %s\n"), zonename, md->altroot);
2459 z_set_zone_root(ud->altroot);
2478 /* Build zone's zonepath wrt the global BE altroot */
2480 "%s%s", ud->altroot, zonepath);
2510 "altroot %s\n"), zonename, ud->altroot);
2572 /* Generate string for zone's altroot path */
2574 (void) strlcpy(zone_altroot, md->altroot, sizeof (zone_altroot));
2578 zone_md.altroot = zone_altroot;
2632 (void) strlcpy(zone_altroot, ud->altroot, sizeof (zone_altroot));
2636 zone_ud.altroot = zone_altroot;