From owner-freebsd-current Sat Feb 9 17: 5:50 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 76CDE37B421; Sat, 9 Feb 2002 17:05:34 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id MAA11699; Sun, 10 Feb 2002 12:05:29 +1100 Date: Sun, 10 Feb 2002 12:08:12 +1100 (EST) From: Bruce Evans X-X-Sender: To: Julian Elischer Cc: John Baldwin , FreeBSD current users Subject: Re: cred stuff.. In-Reply-To: Message-ID: <20020210114611.W5212-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 9 Feb 2002, Julian Elischer wrote: > On Sun, 10 Feb 2002, Bruce Evans wrote: > > > On Fri, 8 Feb 2002, Julian Elischer wrote: > ... > > > and in userret() and ast() > > > > > > >#ifdef DEBUG /*your choice of variable here*/ > > > > if (td->td_ucred != NULL) { > > > > mtx_lock(&Giant); > > > > crfree(td->td_ucred); > > > > td->td_ucred = NULL; > > > > mtx_unlock(&Giant); > > > > } > > > >#endif > > > > I think this is better left where it is in the functions that aquire > > the locks. It can then be done unconditionally, and not in a loop. > > AST is not always called > and userret is always called, but unfortunatly sometimes multiple times userret() isn't always called either in my version :-). When I'm finished, it will never be called (but I might rename ast() to userret() since it is essenttially the unusual case for the original userret()). > if someone were to clean up AST/userret > it would be easier, but I am not sure I understand all the issues.. > > Particularly the interraction between ast() and userret() and the various > possible ASTs Logically, it belongs at the end of userret(), but I would prefer it to be immediately after all calls to userret() like it almost is now so that I don't have to change it. ast() is not special here, modulo optimizations -- it is just one caller of userret(). Think of it as just an optimization of once case of trap(). > > The style of the null pointer check in this is bug for bug compatible > > with the corresponding one above. > > which way would you prefer? I prefer explicit comparisions with NULL and 0 except for booleans. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message