From c3fb5f8be16f0416708a0f968b0584e5201512b4 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 3 Nov 1998 15:02:29 +0000 Subject: A feeble attempt at kld compatability. The mount_* programs assume that they cannot mount a filesystem that they cannot see in getvfsbyname(). Part 1 of this is a hack, make vfsisloadable() always return true - the ultimate decider of whether it's loadable or not is kldload() or mount(). Part 2 of this is to have vfsload() call kldload(2) and return success if it works. This means that we will use a viable kld module in preference to an LKM! Ultimately, the thing to do is remove the hacks to do a vfsload in all the mount_* commands and let the kernel do it by itself in mount(2). --- lib/libc/gen/getvfsent.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/gen/getvfsent.c b/lib/libc/gen/getvfsent.c index 469ef97..8aa147d 100644 --- a/lib/libc/gen/getvfsent.c +++ b/lib/libc/gen/getvfsent.c @@ -193,6 +193,7 @@ vfspath(const char *name) int vfsisloadable(const char *name) { +#if 0 int fd; fd = open("/dev/lkm", O_RDWR, 0); @@ -202,16 +203,24 @@ vfsisloadable(const char *name) close(fd); return !!vfspath(name); +#else + return 1; +#endif } int vfsload(const char *name) { - const char *path = vfspath(name); + const char *path; char name_mod[sizeof("_mod") + strlen(name)]; pid_t pid; int status; + status = kldload(name); + if (status != -1) + return 0; + + path = vfspath(name); if(!path) { errno = ENOENT; return -1; -- cgit v1.1