diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-27 00:59:04 +0000 |
---|---|---|
committer | Keith M Wesolowski <wesolows@foobazco.org> | 2013-08-27 00:59:04 +0000 |
commit | 7bf5a6f485b8d8bb5c024482e916542997c5d6b6 (patch) | |
tree | f0a0bf8503f8174fd9b500feff8547cab885132d /usr/src/lib/libbe/common/be_mount.c | |
parent | d907c5084d3f67c85c5551ee093457940f8aec17 (diff) | |
download | illumos-joyent-7bf5a6f485b8d8bb5c024482e916542997c5d6b6.tar.gz |
back out merge: incompatible ZFS throttling mechanisms
Diffstat (limited to 'usr/src/lib/libbe/common/be_mount.c')
-rw-r--r-- | usr/src/lib/libbe/common/be_mount.c | 60 |
1 files changed, 15 insertions, 45 deletions
diff --git a/usr/src/lib/libbe/common/be_mount.c b/usr/src/lib/libbe/common/be_mount.c index bda2b20b12..6c631da67d 100644 --- a/usr/src/lib/libbe/common/be_mount.c +++ b/usr/src/lib/libbe/common/be_mount.c @@ -23,7 +23,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* @@ -31,7 +31,6 @@ */ #include <assert.h> #include <errno.h> -#include <libgen.h> #include <libintl.h> #include <libnvpair.h> #include <libzfs.h> @@ -327,29 +326,14 @@ _be_mount(char *be_name, char **altroot, int flags) tmp_altroot = *altroot; } - md.altroot = tmp_altroot; - md.shared_fs = flags & BE_MOUNT_FLAG_SHARED_FS; - md.shared_rw = flags & BE_MOUNT_FLAG_SHARED_RW; - /* Mount the BE's root file system */ - if (getzoneid() == GLOBAL_ZONEID) { - if ((ret = be_mount_root(zhp, tmp_altroot)) != BE_SUCCESS) { - be_print_err(gettext("be_mount: failed to " - "mount BE root file system\n")); - if (gen_tmp_altroot) - free(tmp_altroot); - ZFS_CLOSE(zhp); - return (ret); - } - } else { - /* Legacy mount the zone root dataset */ - if ((ret = be_mount_zone_root(zhp, &md)) != BE_SUCCESS) { - be_print_err(gettext("be_mount: failed to " - "mount BE zone root file system\n")); - free(md.altroot); - ZFS_CLOSE(zhp); - return (ret); - } + if ((ret = be_mount_root(zhp, tmp_altroot)) != BE_SUCCESS) { + be_print_err(gettext("be_mount: failed to " + "mount BE root file system\n")); + if (gen_tmp_altroot) + free(tmp_altroot); + ZFS_CLOSE(zhp); + return (ret); } /* Iterate through BE's children filesystems */ @@ -363,6 +347,10 @@ _be_mount(char *be_name, char **altroot, int flags) return (err); } + md.altroot = tmp_altroot; + md.shared_fs = flags & BE_MOUNT_FLAG_SHARED_FS; + md.shared_rw = flags & BE_MOUNT_FLAG_SHARED_RW; + /* * Mount shared file systems if mount flag says so. */ @@ -540,16 +528,9 @@ _be_unmount(char *be_name, int flags) } /* Unmount this BE's root filesystem */ - if (getzoneid() == GLOBAL_ZONEID) { - if ((ret = be_unmount_root(zhp, &ud)) != BE_SUCCESS) { - ZFS_CLOSE(zhp); - return (ret); - } - } else { - if ((ret = be_unmount_zone_root(zhp, &ud)) != BE_SUCCESS) { - ZFS_CLOSE(zhp); - return (ret); - } + if ((ret = be_unmount_root(zhp, &ud)) != BE_SUCCESS) { + ZFS_CLOSE(zhp); + return (ret); } ZFS_CLOSE(zhp); @@ -572,7 +553,6 @@ _be_unmount(char *be_name, int flags) int be_mount_zone_root(zfs_handle_t *zhp, be_mount_data_t *md) { - struct stat buf; char mountpoint[MAXPATHLEN]; int err = 0; @@ -596,16 +576,6 @@ be_mount_zone_root(zfs_handle_t *zhp, be_mount_data_t *md) return (BE_ERR_ZONE_ROOT_NOT_LEGACY); } - /* Create the mountpoint if it doesn't exist */ - if (lstat(md->altroot, &buf) != 0) { - if (mkdirp(md->altroot, 0755) != 0) { - err = errno; - be_print_err(gettext("be_mount_zone_root: failed " - "to create mountpoint %s\n"), md->altroot); - return (errno_to_be_err(err)); - } - } - /* * Legacy mount the zone root dataset. * |