[PATCH 2.6.17-rc6-mm2 6/6] ieee1394: convert nodemgr_serializesemaphore to mutex

From: Stefan Richter
Date: Sun Jun 18 2006 - 13:04:50 EST


Another trivial sem2mutex conversion.

Side note: nodemgr_serialize's purpose, when introduced in linux1394's
revision 529 in July 2002, was to protect several data structures which
are now largely handled by or together with Linux' driver core and are
now protected by the LDM's own mechanisms. It may very well be possible
to get rid of this mutex entirely now. But fully parallelized node
scanning is on our long-term TODO list anyway.

Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
---
Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c 2006-06-18 16:34:45.000000000 +0200
+++ linux/drivers/ieee1394/nodemgr.c 2006-06-18 17:28:48.000000000 +0200
@@ -157,7 +157,7 @@ static struct csr1212_bus_ops nodemgr_cs
* but now we are much simpler because of the LDM.
*/

-static DECLARE_MUTEX(nodemgr_serialize);
+static DEFINE_MUTEX(nodemgr_serialize);

struct host_info {
struct hpsb_host *host;
@@ -1615,7 +1615,7 @@ static int nodemgr_host_thread(void *__h
if (kthread_should_stop())
goto exit;

- if (down_interruptible(&nodemgr_serialize)) {
+ if (mutex_lock_interruptible(&nodemgr_serialize)) {
if (try_to_freeze())
continue;
goto exit;
@@ -1644,7 +1644,7 @@ static int nodemgr_host_thread(void *__h
if (!nodemgr_check_irm_capability(host, reset_cycles) ||
!nodemgr_do_irm_duties(host, reset_cycles)) {
reset_cycles++;
- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
continue;
}
reset_cycles = 0;
@@ -1662,10 +1662,10 @@ static int nodemgr_host_thread(void *__h
/* Update some of our sysfs symlinks */
nodemgr_update_host_dev_links(host);

- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
}
unlock_exit:
- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
exit:
HPSB_VERBOSE("NodeMgr: Exiting thread");
return 0;


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