Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 2003 15:08:33 +0200 (CEST)
From:      Soren Schmidt <sos@spider.deepcore.dk>
To:        Nate Lawson <nate@root.org>
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
Message-ID:  <200309061308.h86D8Xwq023001@spider.deepcore.dk>
In-Reply-To: <20030905150357.U72582@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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