Re: io_request_lock question (2.2)

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Thu Dec 07 2000 - 19:24:18 EST


> I looked at the implementation of the nbd which just calls
>
> spin_unlock_irq(&io_request_lock);
> ... do network io ...
> spin_lock_irq(&io_request_lock);
>
> This seems to work but it looks very dangerous to me (and ugly, too). Isn't there a better way to do this?

It is only dangerous if you unlock it in the wrong place, unlocking it as much
as possible is good behaviour. You need it locked until you get the actual
request off the queue, you need it locked when you complete the request. The
rest of the time you can be polite

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



This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 21:00:19 EST