Re: [PATCH] Introduce down_try() so we can move away fromdown_trylock()

From: Andrew Morton
Date: Fri Aug 01 2008 - 13:41:15 EST


On Fri, 1 Aug 2008 10:26:33 -0700 (PDT) Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> > I planned on removing the much-disliked down_trylock() (with its
> > backwards return codes) in 2.6.27, but it's creating something of a
> > logjam with other patches in -mm and linux-next.
> >
> > Andrew suggested introducing "down_try" as a wrapper now, to make
> > the transition easier.
>
> The transition to WHAT? To crap?
>

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/