diff options
author | peter <peter@FreeBSD.org> | 1998-11-03 15:02:29 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-11-03 15:02:29 +0000 |
commit | c3fb5f8be16f0416708a0f968b0584e5201512b4 (patch) | |
tree | 2f4a79316ce16843a755b919f3c3a9bbdb23870a /lib/libc/gen/getvfsent.c | |
parent | 43589c7042343335851bafe0fd3d06e47bd64e80 (diff) | |
download | FreeBSD-src-c3fb5f8be16f0416708a0f968b0584e5201512b4.zip FreeBSD-src-c3fb5f8be16f0416708a0f968b0584e5201512b4.tar.gz |
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).
Diffstat (limited to 'lib/libc/gen/getvfsent.c')
-rw-r--r-- | lib/libc/gen/getvfsent.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |