Re: [PATCH] kill DECLARE_MUTEX_LOCKED

From: Satyam Sharma
Date: Fri Jul 20 2007 - 01:28:44 EST


Hi Christoph,

On 7/20/07, Christoph Hellwig <hch@xxxxxx> wrote:
DECLARE_MUTEX_LOCKED was used for semaphores used as completions and
we've got rid of them.

Thanks, I'd been meaning to do this for months :-)
Had even audited the kernel for its usage ... just didn't make or
send out a patch, sorry.

Well, except for one in libusual that the
maintainer explicitly wants to keep as semaphore.

That comment in libusual is quite nonsensical, IMHO. Note that
usu_init_notify is declared as DECLARE_MUTEX_LOCKED and yet the
author wants us to believe (later, when he's doing that dummy

down();
/* nothing here */
up();

stuff at line no. 181) that the semaphore is somehow "counted" ...
Has anybody tried going through all the logic in that file? Looks totally
weird to me ... :-) Nothing in there that can't be serialized using proper
primitives.

So convert that
useage to an explicit sema_init and kill of DECLARE_MUTEX_LOCKED so that
new code is reminded to use a completion.

and I guess nobody cares a whit for the #if 0'ed stuff in drivers/fc4/fc.c

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Well, probably not worth much, but: Ack.

Satyam
-
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/