Commit e11f0d04 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin Schwidefsky

[S390] arch/s390/kernel/debug.c: use mutex instead of semaphore

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 3006d7c6
...@@ -163,7 +163,7 @@ unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION; ...@@ -163,7 +163,7 @@ unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION;
static debug_info_t *debug_area_first = NULL; static debug_info_t *debug_area_first = NULL;
static debug_info_t *debug_area_last = NULL; static debug_info_t *debug_area_last = NULL;
static DECLARE_MUTEX(debug_lock); static DEFINE_MUTEX(debug_mutex);
static int initialized; static int initialized;
...@@ -576,7 +576,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length, ...@@ -576,7 +576,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
int rc = 0; int rc = 0;
file_private_info_t *p_info; file_private_info_t *p_info;
down(&debug_lock); mutex_lock(&debug_mutex);
p_info = ((file_private_info_t *) file->private_data); p_info = ((file_private_info_t *) file->private_data);
if (p_info->view->input_proc) if (p_info->view->input_proc)
rc = p_info->view->input_proc(p_info->debug_info_org, rc = p_info->view->input_proc(p_info->debug_info_org,
...@@ -584,7 +584,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length, ...@@ -584,7 +584,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
length, offset); length, offset);
else else
rc = -EPERM; rc = -EPERM;
up(&debug_lock); mutex_unlock(&debug_mutex);
return rc; /* number of input characters */ return rc; /* number of input characters */
} }
...@@ -602,7 +602,7 @@ debug_open(struct inode *inode, struct file *file) ...@@ -602,7 +602,7 @@ debug_open(struct inode *inode, struct file *file)
file_private_info_t *p_info; file_private_info_t *p_info;
debug_info_t *debug_info, *debug_info_snapshot; debug_info_t *debug_info, *debug_info_snapshot;
down(&debug_lock); mutex_lock(&debug_mutex);
debug_info = file->f_path.dentry->d_inode->i_private; debug_info = file->f_path.dentry->d_inode->i_private;
/* find debug view */ /* find debug view */
for (i = 0; i < DEBUG_MAX_VIEWS; i++) { for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
...@@ -653,7 +653,7 @@ debug_open(struct inode *inode, struct file *file) ...@@ -653,7 +653,7 @@ debug_open(struct inode *inode, struct file *file)
file->private_data = p_info; file->private_data = p_info;
debug_info_get(debug_info); debug_info_get(debug_info);
out: out:
up(&debug_lock); mutex_unlock(&debug_mutex);
return rc; return rc;
} }
...@@ -688,7 +688,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size) ...@@ -688,7 +688,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size)
if (!initialized) if (!initialized)
BUG(); BUG();
down(&debug_lock); mutex_lock(&debug_mutex);
/* create new debug_info */ /* create new debug_info */
...@@ -702,7 +702,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size) ...@@ -702,7 +702,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size)
if (!rc){ if (!rc){
printk(KERN_ERR "debug: debug_register failed for %s\n",name); printk(KERN_ERR "debug: debug_register failed for %s\n",name);
} }
up(&debug_lock); mutex_unlock(&debug_mutex);
return rc; return rc;
} }
...@@ -716,9 +716,9 @@ debug_unregister(debug_info_t * id) ...@@ -716,9 +716,9 @@ debug_unregister(debug_info_t * id)
{ {
if (!id) if (!id)
goto out; goto out;
down(&debug_lock); mutex_lock(&debug_mutex);
debug_info_put(id); debug_info_put(id);
up(&debug_lock); mutex_unlock(&debug_mutex);
out: out:
return; return;
...@@ -1054,11 +1054,11 @@ __init debug_init(void) ...@@ -1054,11 +1054,11 @@ __init debug_init(void)
int rc = 0; int rc = 0;
s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table); s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
down(&debug_lock); mutex_lock(&debug_mutex);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL); debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
printk(KERN_INFO "debug: Initialization complete\n"); printk(KERN_INFO "debug: Initialization complete\n");
initialized = 1; initialized = 1;
up(&debug_lock); mutex_unlock(&debug_mutex);
return rc; return rc;
} }
......
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