Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Mar 2002 11:33:56 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Robert Watson <rwatson@FreeBSD.ORG>
Cc:        smp@FreeBSD.ORG, Bruce Evans <bde@zeta.org.au>, Julian Elischer <julian@elischer.org>
Subject:   Re: suser() API change patch
Message-ID:  <XFMail.20020329113356.jhb@FreeBSD.org>
In-Reply-To: <Pine.NEB.3.96L.1020328233618.1932n-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020329113356.jhb>