diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-23 03:00:24 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 07:38:10 -0800 |
commit | 97d1f15b7ef52c1e9c28dc48b454024bb53a5fd2 (patch) | |
tree | 7bdb928096eec577e75897351f639d3f94441c87 /lib/reed_solomon | |
parent | e723ccd805857a46d3b63fbd20edea8579c6c541 (diff) |
[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>
Diffstat (limited to 'lib/reed_solomon')
-rw-r--r-- | lib/reed_solomon/reed_solomon.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/reed_solomon/reed_solomon.c b/lib/reed_solomon/reed_solomon.c index f5fef948a415..f8ac9fa95de1 100644 --- a/lib/reed_solomon/reed_solomon.c +++ b/lib/reed_solomon/reed_solomon.c @@ -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; } |