Commit d158d261 authored by Jes Sorensen's avatar Jes Sorensen Committed by James Bottomley

[SCSI] sem2mutex: scsi_transport_spi.c

Convert the SCSI transport class code to use a mutex rather than a
semaphore.
Signed-off-by: default avatarJes Sorensen <jes@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f20139be
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <asm/semaphore.h> #include <linux/mutex.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
#include "scsi_priv.h" #include "scsi_priv.h"
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
/* Private data accessors (keep these out of the header file) */ /* Private data accessors (keep these out of the header file) */
#define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending) #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
#define spi_dv_sem(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_sem) #define spi_dv_mutex(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_mutex)
struct spi_internal { struct spi_internal {
struct scsi_transport_template t; struct scsi_transport_template t;
...@@ -242,7 +242,7 @@ static int spi_setup_transport_attrs(struct transport_container *tc, ...@@ -242,7 +242,7 @@ static int spi_setup_transport_attrs(struct transport_container *tc,
spi_hold_mcs(starget) = 0; spi_hold_mcs(starget) = 0;
spi_dv_pending(starget) = 0; spi_dv_pending(starget) = 0;
spi_initial_dv(starget) = 0; spi_initial_dv(starget) = 0;
init_MUTEX(&spi_dv_sem(starget)); mutex_init(&spi_dv_mutex(starget));
return 0; return 0;
} }
...@@ -915,7 +915,7 @@ spi_dv_device(struct scsi_device *sdev) ...@@ -915,7 +915,7 @@ spi_dv_device(struct scsi_device *sdev)
scsi_target_quiesce(starget); scsi_target_quiesce(starget);
spi_dv_pending(starget) = 1; spi_dv_pending(starget) = 1;
down(&spi_dv_sem(starget)); mutex_lock(&spi_dv_mutex(starget));
starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n"); starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n");
...@@ -923,7 +923,7 @@ spi_dv_device(struct scsi_device *sdev) ...@@ -923,7 +923,7 @@ spi_dv_device(struct scsi_device *sdev)
starget_printk(KERN_INFO, starget, "Ending Domain Validation\n"); starget_printk(KERN_INFO, starget, "Ending Domain Validation\n");
up(&spi_dv_sem(starget)); mutex_unlock(&spi_dv_mutex(starget));
spi_dv_pending(starget) = 0; spi_dv_pending(starget) = 0;
scsi_target_resume(starget); scsi_target_resume(starget);
......
...@@ -54,7 +54,7 @@ struct spi_transport_attrs { ...@@ -54,7 +54,7 @@ struct spi_transport_attrs {
unsigned int support_qas; /* supports quick arbitration and selection */ unsigned int support_qas; /* supports quick arbitration and selection */
/* Private Fields */ /* Private Fields */
unsigned int dv_pending:1; /* Internal flag */ unsigned int dv_pending:1; /* Internal flag */
struct semaphore dv_sem; /* semaphore to serialise dv */ struct mutex dv_mutex; /* semaphore to serialise dv */
}; };
enum spi_signal_type { enum spi_signal_type {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment