Mailinglist Archive: opensuse-kernel (109 mails)

< Previous Next >
Re: [opensuse-kernel] novfs: replace MUTEX by sema functions
  • From: Jan Engelhardt <jengelh@xxxxxxxxxx>
  • Date: Sun, 7 Mar 2010 16:35:58 +0100 (CET)
  • Message-id: <alpine.LSU.2.01.1003071634120.20138@xxxxxxxxxxxxxxx>
On Sunday 2010-03-07 14:56, Bernhard Walle wrote:

Am 07.03.10 14:53, schrieb Jan Engelhardt:
On Sunday 2010-03-07 14:46, Bernhard Walle wrote:

Am 07.03.10 14:10, schrieb Jan Engelhardt:
On Sunday 2010-03-07 13:59, Jean Delvare wrote:

On Saturday 06 March 2010 08:21:32 pm Jan Engelhardt wrote:
Avoid old MUTEX macros and use sema instead, which works
for both default and RT kernels.

Do you actually need the power of semaphores?

Dunno, I did not write novfs. I just made it compile again.

Since you replaced DECLARE_MUTEX with it, I'm sure you don't. :)

From your patch:

-static DECLARE_MUTEX(DriveMapLock);
+static struct semaphore DriveMapLock;

So you replaced the old DECLARE_MUTEX() (which is actually a binary semaphore
as Jean mentioned) with struct semaphore. Which is not wrong, of course. But
shows that the semaphore was used as mutex, so I don't see a problem with
the new Mutex API as Jean mentioned.

You would have to check whether the sema is held in sleeping, which
newmutexes are not allowed to.
To unsubscribe, e-mail: opensuse-kernel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kernel+help@xxxxxxxxxxxx

< Previous Next >