Date: Fri, 29 Mar 2002 22:29:46 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Julian Elischer <julian@elischer.org> Cc: Alfred Perlstein <bright@mu.org>, John Baldwin <jhb@FreeBSD.ORG>, arch@FreeBSD.ORG Subject: Re: curthread vs. passing thread pointers around Message-ID: <89671.1017437386@critter.freebsd.dk> In-Reply-To: Your message of "Fri, 29 Mar 2002 12:41:46 PST." <Pine.BSF.4.21.0203291234080.726-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.21.0203291234080.726-100000@InterJet.elischer.org>, Juli an Elischer writes: >> On a related note: I intend to change the open/close/ioctl interface >> to device drivers from a "struct thread *" to a "struct ucred > >That's probably ok, though I have an uneasy feeling about it.. > >I'd go further and say that you should not even pass that. >anyone needing it can do curthread->td_ucred. Yeah, well, unless you run GEOM where the request may have been queued and you're running in context of a worker thread. (The infinite stacking issue again). >I think we could make a case for CURRENT code that we need not >pass anything at all, but what are we cutting out in th epossible future? That's what I'm afraid off too. There are several things in this, one of which is locking, the other the scale of changes needed to fix up the tree. The simple solution is probably to add three new members to cdevsw{}: sopen, sclose, sioctl (s for simple or something) which doesn't have that final argument at all. Drivers can be converted gradually. Specfs can figure out which version of the method to call, and do locking as/if needed. I really wish we had a compile-time optimized version of KOBJ we could use for devsw... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?89671.1017437386>