summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_conf.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-11-28 22:20:18 +0000
committermsmith <msmith@FreeBSD.org>1999-11-28 22:20:18 +0000
commit1de8077aec0521daa28eba6c7da66bbd2a3af021 (patch)
treecee43a73dbef0bd6803363a441c02569a3c9e4d1 /sys/kern/vfs_conf.c
parenta5251563a0e22a134b4eca505f19b029538f8485 (diff)
downloadFreeBSD-src-1de8077aec0521daa28eba6c7da66bbd2a3af021.zip
FreeBSD-src-1de8077aec0521daa28eba6c7da66bbd2a3af021.tar.gz
Use the correct mounted-from path when allocating the root mount, if we know
what it is. Be more correct in unbusying the mountpoint (especially before freeing it). Remove support for mounting 'r' devices as root. You don't mount 'r' devices anywhere else, and they're going away anyway. Submitted by: bde
Diffstat (limited to 'sys/kern/vfs_conf.c')
-rw-r--r--sys/kern/vfs_conf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c
index e63343c..afa6fa5 100644
--- a/sys/kern/vfs_conf.c
+++ b/sys/kern/vfs_conf.c
@@ -186,7 +186,9 @@ vfs_mountroot_try(char *mountfrom)
goto done;
/* allocate a root mount */
- if ((error = vfs_rootmountalloc(vfsname, ROOTNAME, &mp))) {
+ error = vfs_rootmountalloc(vfsname, path[0] != 0 ? path : ROOTNAME,
+ &mp);
+ if (error != 0) {
printf("Can't allocate root mount for filesystem '%s': %d\n",
vfsname, error);
goto done;
@@ -201,7 +203,6 @@ vfs_mountroot_try(char *mountfrom)
if (devsw(rootdev) && (devsw(rootdev)->d_flags & D_MEMDISK))
mp->mnt_flag &= ~MNT_RDONLY;
- strcpy(mp->mnt_stat.f_mntfromname, path);
error = VFS_MOUNT(mp, NULL, NULL, NULL, curproc);
done:
@@ -210,8 +211,10 @@ done:
if (path != NULL)
free(path, M_MOUNT);
if (error != 0) {
- if (mp != NULL)
+ if (mp != NULL) {
+ vfs_unbusy(mp, curproc);
free(mp, M_MOUNT);
+ }
printf("Root mount failed: %d\n", error);
} else {
@@ -222,9 +225,8 @@ done:
/* sanity check system clock against root filesystem timestamp */
inittodr(mp->mnt_time);
- }
- if (mp != NULL)
vfs_unbusy(mp, curproc);
+ }
return(error);
}
@@ -318,8 +320,6 @@ setrootbyname(char *name)
if (cp != NULL) {
name = cp + 1;
}
- if (*name == 'r')
- name++;
cp = name;
while (cp != '\0' && (*cp < '0' || *cp > '9'))
cp++;
OpenPOWER on IntegriCloud