aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_proc.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-11 07:16:10 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-12 12:53:11 -0500
commit0b9506723826c68b50fa33e345700ddcac1bed36 (patch)
treeda3e432ef4517c47ebdc088c6322d0ac51193127 /drivers/scsi/scsi_proc.c
parentdacee84b070c4e705a5b6446f1f0a6a6e2f8d7a4 (diff)
[SCSI] turn most scsi semaphores into mutexes
the scsi layer is using semaphores in a mutex way, this patch converts these into using mutexes instead Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_proc.c')
-rw-r--r--drivers/scsi/scsi_proc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index a50958b1b6ee..1b5711e714a5 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -25,6 +25,7 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/blkdev.h> 26#include <linux/blkdev.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/mutex.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29 30
30#include <scsi/scsi.h> 31#include <scsi/scsi.h>
@@ -41,7 +42,7 @@
41static struct proc_dir_entry *proc_scsi; 42static struct proc_dir_entry *proc_scsi;
42 43
43/* Protect sht->present and sht->proc_dir */ 44/* Protect sht->present and sht->proc_dir */
44static DECLARE_MUTEX(global_host_template_sem); 45static DEFINE_MUTEX(global_host_template_mutex);
45 46
46static int proc_scsi_read(char *buffer, char **start, off_t offset, 47static int proc_scsi_read(char *buffer, char **start, off_t offset,
47 int length, int *eof, void *data) 48 int length, int *eof, void *data)
@@ -83,7 +84,7 @@ void scsi_proc_hostdir_add(struct scsi_host_template *sht)
83 if (!sht->proc_info) 84 if (!sht->proc_info)
84 return; 85 return;
85 86
86 down(&global_host_template_sem); 87 mutex_lock(&global_host_template_mutex);
87 if (!sht->present++) { 88 if (!sht->present++) {
88 sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi); 89 sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi);
89 if (!sht->proc_dir) 90 if (!sht->proc_dir)
@@ -92,7 +93,7 @@ void scsi_proc_hostdir_add(struct scsi_host_template *sht)
92 else 93 else
93 sht->proc_dir->owner = sht->module; 94 sht->proc_dir->owner = sht->module;
94 } 95 }
95 up(&global_host_template_sem); 96 mutex_unlock(&global_host_template_mutex);
96} 97}
97 98
98void scsi_proc_hostdir_rm(struct scsi_host_template *sht) 99void scsi_proc_hostdir_rm(struct scsi_host_template *sht)
@@ -100,12 +101,12 @@ void scsi_proc_hostdir_rm(struct scsi_host_template *sht)
100 if (!sht->proc_info) 101 if (!sht->proc_info)
101 return; 102 return;
102 103
103 down(&global_host_template_sem); 104 mutex_lock(&global_host_template_mutex);
104 if (!--sht->present && sht->proc_dir) { 105 if (!--sht->present && sht->proc_dir) {
105 remove_proc_entry(sht->proc_name, proc_scsi); 106 remove_proc_entry(sht->proc_name, proc_scsi);
106 sht->proc_dir = NULL; 107 sht->proc_dir = NULL;
107 } 108 }
108 up(&global_host_template_sem); 109 mutex_unlock(&global_host_template_mutex);
109} 110}
110 111
111void scsi_proc_host_add(struct Scsi_Host *shost) 112void scsi_proc_host_add(struct Scsi_Host *shost)