From owner-cvs-all@FreeBSD.ORG Sat Sep 6 06:08:58 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06E4816A4BF; Sat, 6 Sep 2003 06:08:58 -0700 (PDT) Received: from spider.deepcore.dk (cpe.atm2-0-56339.0x50c6aa0a.abnxx2.customer.tele.dk [80.198.170.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10EC543FF3; Sat, 6 Sep 2003 06:08:56 -0700 (PDT) (envelope-from sos@spider.deepcore.dk) Received: from spider.deepcore.dk (localhost [127.0.0.1]) by spider.deepcore.dk (8.12.9/8.12.9) with ESMTP id h86D8YIo023002; Sat, 6 Sep 2003 15:08:35 +0200 (CEST) (envelope-from sos@spider.deepcore.dk) Received: (from sos@localhost) by spider.deepcore.dk (8.12.9/8.12.9/Submit) id h86D8Xwq023001; Sat, 6 Sep 2003 15:08:33 +0200 (CEST) From: Soren Schmidt Message-Id: <200309061308.h86D8Xwq023001@spider.deepcore.dk> In-Reply-To: <20030905150357.U72582@root.org> To: Nate Lawson Date: Sat, 6 Sep 2003 15:08:33 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL99f (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 X-mail-scanned: by DeepCore Virus & Spam killer v1.3 cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: "David G. Lawrence" cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/ata ata-all.c ata-disk.c ata-disk.hatapi-all.c atapi-all.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2003 13:08:58 -0000 It seems Nate Lawson wrote: > On Fri, 5 Sep 2003, David G. Lawrence wrote: > > Nate Lawson wrote: > > > Yikes, invasive. Is there a way to do a "if (held(lock))" construct > > > instead? > > > > What do you mean by invasive? > > Changing all the callers to pass a flag whether or not they hold the lock. > I'm not experienced with what the best accepted approach to locking is. > However, it seems like locks should not require external information (i.e. > hints) or recursion generally. I understand this is not an OS lock but an > ATA lock but it seems like the same principle would apply. My question is > whether there is a way the call path can be changed so that the flag is > implicit or for the exception case there is a way to query the lock to see > if it's already held. Would such an approach be feasible? Please keep in mund that this is only a stopgap solution until the ATA driver from -current gets backported... -Søren