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).
This commit is contained in:
Peter Wemm 1998-11-03 15:02:29 +00:00
parent 02fc72dbe5
commit 86854f0360
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40863

View File

@ -193,6 +193,7 @@ vfspath(const char *name)
int int
vfsisloadable(const char *name) vfsisloadable(const char *name)
{ {
#if 0
int fd; int fd;
fd = open("/dev/lkm", O_RDWR, 0); fd = open("/dev/lkm", O_RDWR, 0);
@ -202,16 +203,24 @@ vfsisloadable(const char *name)
close(fd); close(fd);
return !!vfspath(name); return !!vfspath(name);
#else
return 1;
#endif
} }
int int
vfsload(const char *name) vfsload(const char *name)
{ {
const char *path = vfspath(name); const char *path;
char name_mod[sizeof("_mod") + strlen(name)]; char name_mod[sizeof("_mod") + strlen(name)];
pid_t pid; pid_t pid;
int status; int status;
status = kldload(name);
if (status != -1)
return 0;
path = vfspath(name);
if(!path) { if(!path) {
errno = ENOENT; errno = ENOENT;
return -1; return -1;