[PATCH] sem2mutex: kernel/

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Arjan van de Ven
2006-03-23 03:00:24 -08:00
committed by Linus Torvalds
parent e723ccd805
commit 97d1f15b7e
6 changed files with 36 additions and 30 deletions

View File

@ -44,12 +44,13 @@
#include <linux/module.h>
#include <linux/rslib.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <asm/semaphore.h>
/* This list holds all currently allocated rs control structures */
static LIST_HEAD (rslist);
/* Protection for the list */
static DECLARE_MUTEX(rslistlock);
static DEFINE_MUTEX(rslistlock);
/**
* rs_init - Initialize a Reed-Solomon codec
@ -161,7 +162,7 @@ errrs:
*/
void free_rs(struct rs_control *rs)
{
down(&rslistlock);
mutex_lock(&rslistlock);
rs->users--;
if(!rs->users) {
list_del(&rs->list);
@ -170,7 +171,7 @@ void free_rs(struct rs_control *rs)
kfree(rs->genpoly);
kfree(rs);
}
up(&rslistlock);
mutex_unlock(&rslistlock);
}
/**
@ -201,7 +202,7 @@ struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim,
if (nroots < 0 || nroots >= (1<<symsize))
return NULL;
down(&rslistlock);
mutex_lock(&rslistlock);
/* Walk through the list and look for a matching entry */
list_for_each(tmp, &rslist) {
@ -228,7 +229,7 @@ struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim,
list_add(&rs->list, &rslist);
}
out:
up(&rslistlock);
mutex_unlock(&rslistlock);
return rs;
}