From owner-freebsd-arch Fri Mar 29 13:20:32 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id B7DB837B400; Fri, 29 Mar 2002 13:20:14 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020329212014.SVOW2928.rwcrmhc53.attbi.com@InterJet.elischer.org>; Fri, 29 Mar 2002 21:20:14 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA00923; Fri, 29 Mar 2002 12:41:47 -0800 (PST) Date: Fri, 29 Mar 2002 12:41:46 -0800 (PST) From: Julian Elischer To: Poul-Henning Kamp Cc: Alfred Perlstein , John Baldwin , arch@FreeBSD.ORG Subject: Re: curthread vs. passing thread pointers around In-Reply-To: <72088.1017431691@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 29 Mar 2002, Poul-Henning Kamp wrote: > In message <20020329194158.GX93885@elvis.mu.org>, Alfred Perlstein writes: > >* John Baldwin [020329 11:32] wrote: > >> During a discussion on the smp@ list about changes to the suser() > >> API to make use of td_ucred, [...] > > 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. Hardly any drivers use it. Since AIO doesn't include open/close I am not sure I can think of a case when the curthread is not the thread that should be charged/authorised with the open/ioctl/close. In many cases td is only used to fead to suser*() in which case it wouldn't be needed at all. 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? > > -- > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message