[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0808011118560.3277@nehalem.linux-foundation.org>
Date: Fri, 1 Aug 2008 11:22:12 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Rusty Russell <rusty@...tcorp.com.au>,
Paul Menage <menage@...gle.com>, linux-kernel@...r.kernel.org,
Matthew Wilcox <matthew@....cx>,
"Randy.Dunlap" <rdunlap@...otime.net>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] Introduce down_try() so we can move away from
down_trylock()
On Fri, 1 Aug 2008, Andrew Morton wrote:
> >
>
> The naming is pretty sad, but the inconsistent return value from
> down_trylock() drives me batshit. It means that every time I ever look
> at any sort of trylock call I need to go back to the definition site to
> work out if it's the one which returns true or if it's the one which
> returns false.
>
> It would be good to get that fixed. And if we _do_ want to fix it, I
> don't see any alternative to creating a new function.
The alternative is to just get rid of "down_trylock()" entirely. Creatign
a shadow function with a different return value is just going to confuse
people even more than the current situation.
That's why I pointed out that all the current users (apart from the
special console usage) really do look like prime candidates to just
convert to mutexes.
Of course, regardless, _some_ of those have actually taken the
down_trylock semantics. See
#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem)
so nothing gets rid of that ;)
But at least it should be possible to replace something like half the
current users of down_trylock() by just teh trivial conversion to mutexes.
Which would be a good thing regardless.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists