From owner-freebsd-smp Fri Mar 29 8:34:10 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mail14.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by hub.freebsd.org (Postfix) with ESMTP id E990537B423 for ; Fri, 29 Mar 2002 08:33:55 -0800 (PST) Received: (qmail 25684 invoked from network); 29 Mar 2002 16:33:54 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 29 Mar 2002 16:33:54 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g2TGYgv00662; Fri, 29 Mar 2002 11:34:42 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Fri, 29 Mar 2002 11:33:56 -0500 (EST) From: John Baldwin To: Robert Watson Subject: Re: suser() API change patch Cc: smp@FreeBSD.ORG, Bruce Evans , Julian Elischer 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 29-Mar-2002 Robert Watson wrote: > > 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); Well, is this what everyone wants then? I can change it if this is what everyone agrees to. In a similar vein, should I get rid of the first argument for all the p_canfoo() functions when I change that API as well? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message