From owner-freebsd-smp Thu Mar 28 20:38:56 2002 Delivered-To: freebsd-smp@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 169D737B417; Thu, 28 Mar 2002 20:38:52 -0800 (PST) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.6) with SMTP id g2T4bLw62152; Thu, 28 Mar 2002 23:37:21 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 28 Mar 2002 23:37:20 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Julian Elischer Cc: Bruce Evans , John Baldwin , smp@FreeBSD.ORG Subject: Re: suser() API change patch In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 28 Mar 2002, Julian Elischer wrote: > On Thu, 28 Mar 2002, Bruce Evans wrote: > > suser(thread, flag) could still exist (named somthing like suser_flag()) > > if it is used enough to justify it. My main point is that the flag is > > rarely used, so the interface shouldn't be bloated to pass it. > > > > Another point: td->td_ucred can only be safely used without locking > > if td is curthread. Our current code mostly assumes this. suser(td) > > can easily check that td is curthread, but this is a silly reason to > > use a bloated interface. It is just bug for bug compatible with passing > > thread pointers around a lot. > > Bruce does have a point.. I'll be the first to admit that. It actually suggests the API should be: int suser(void); /* implicitly curthread */ int suser_flags(int flags); /* implicitly curthread */ int suser_cred(struct ucred *cred, int flags); Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message