From c974f9c6a643886f1fd87eedbb82955f3420dc8e Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 22 Sep 1994 02:07:33 +0000 Subject: Use getvfs* functions to map between VFS types and names. Automatically load UFS if it is not present but is loadable. (This won't happen now, but could happen if we fix NFS diskless support.) --- sbin/mount/mount_ufs.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'sbin/mount/mount_ufs.c') diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index babb760a07d8..43dfb055e198 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -72,6 +72,7 @@ mount_ufs(argc, argv) struct ufs_args args; int ch, mntflags; char *fs_name; + struct vfsconf *vfc; mntflags = 0; optind = optreset = 1; /* Reset for parse of new argv. */ @@ -100,7 +101,21 @@ mount_ufs(argc, argv) else args.export.ex_flags = 0; - if (mount(MOUNT_UFS, fs_name, mntflags, &args) < 0) { + setvfsent(0); + if(!(vfc = getvfsbyname("ufs"))) { + if(vfsisloadable("ufs")) { + if(vfsload("ufs")) { + warn("vfsload(\"ufs\")"); + return 1; + } + endvfsent(); /* flush old table */ + vfc = getvfsbyname("ufs"); + } else { + /*warnx("ufs: filesystem not found");*/ + } + } + + if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) { (void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name); switch (errno) { case EMFILE: -- cgit v1.2.3