Date: Tue, 19 Jan 1999 18:04:52 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: dfr@nlsystems.com (Doug Rabson) Cc: archie@whistle.com, freebsd-hackers@FreeBSD.ORG, julian@whistle.com Subject: Re: Loading KLD from the kernel Message-ID: <199901191804.LAA17691@usr04.primenet.com> In-Reply-To: <Pine.BSF.4.01.9901190915370.40696-100000@herring.nlsystems.com> from "Doug Rabson" at Jan 19, 99 09:21:18 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > I tried simply incrementing lf->userrefs after loading the module > > from the kernel, but somehow it went back to zero (?) > > This field is a count of how many times a user has loaded the file using > kldload(2). It is there to prevent a user from unloading a file which was > loaded explicitly by the kernel (e.g. as a dependancy). Incrementing > userrefs should have worked though - can you watch what happens in the > debugger and find out why it is being reset? Shouldn't a kernel load as a dependency also cause a reference count increment? I think the problem is that dependency vs. explicit loads are not seperate in the idea of loading from kernel space. Archie: look closely at the kldload to see what it does differently, since what you are doing is an explicit load from kernel space, which differs from a dependency based load. I think you need to add dependency references, as well, to account for hooks between particular nodes (i.e., the thing need to be a real reference count, not a load count). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901191804.LAA17691>
