aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-31 11:38:03 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-05-31 11:38:11 -0400
commite11f0d04c6bc6bcf301bc60c060c4ac346e61885 (patch)
tree38f400f31c50e659809ed86626df6a529ccdf8e3 /arch/s390
parent3006d7c67139e5173cf58986c7b6e080a893e2ac (diff)
[S390] arch/s390/kernel/debug.c: use mutex instead of semaphore
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/debug.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index dca6eaf82c80..1b2f5ce45320 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -163,7 +163,7 @@ unsigned int debug_feature_version = __DEBUG_FEATURE_VERSION;
163 163
164static debug_info_t *debug_area_first = NULL; 164static debug_info_t *debug_area_first = NULL;
165static debug_info_t *debug_area_last = NULL; 165static debug_info_t *debug_area_last = NULL;
166static DECLARE_MUTEX(debug_lock); 166static DEFINE_MUTEX(debug_mutex);
167 167
168static int initialized; 168static int initialized;
169 169
@@ -576,7 +576,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
576 int rc = 0; 576 int rc = 0;
577 file_private_info_t *p_info; 577 file_private_info_t *p_info;
578 578
579 down(&debug_lock); 579 mutex_lock(&debug_mutex);
580 p_info = ((file_private_info_t *) file->private_data); 580 p_info = ((file_private_info_t *) file->private_data);
581 if (p_info->view->input_proc) 581 if (p_info->view->input_proc)
582 rc = p_info->view->input_proc(p_info->debug_info_org, 582 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 length, offset); 584 length, offset);
585 else 585 else
586 rc = -EPERM; 586 rc = -EPERM;
587 up(&debug_lock); 587 mutex_unlock(&debug_mutex);
588 return rc; /* number of input characters */ 588 return rc; /* number of input characters */
589} 589}
590 590
@@ -602,7 +602,7 @@ debug_open(struct inode *inode, struct file *file)
602 file_private_info_t *p_info; 602 file_private_info_t *p_info;
603 debug_info_t *debug_info, *debug_info_snapshot; 603 debug_info_t *debug_info, *debug_info_snapshot;
604 604
605 down(&debug_lock); 605 mutex_lock(&debug_mutex);
606 debug_info = file->f_path.dentry->d_inode->i_private; 606 debug_info = file->f_path.dentry->d_inode->i_private;
607 /* find debug view */ 607 /* find debug view */
608 for (i = 0; i < DEBUG_MAX_VIEWS; i++) { 608 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
@@ -653,7 +653,7 @@ found:
653 file->private_data = p_info; 653 file->private_data = p_info;
654 debug_info_get(debug_info); 654 debug_info_get(debug_info);
655out: 655out:
656 up(&debug_lock); 656 mutex_unlock(&debug_mutex);
657 return rc; 657 return rc;
658} 658}
659 659
@@ -688,7 +688,7 @@ debug_register (char *name, int pages_per_area, int nr_areas, int buf_size)
688 688
689 if (!initialized) 689 if (!initialized)
690 BUG(); 690 BUG();
691 down(&debug_lock); 691 mutex_lock(&debug_mutex);
692 692
693 /* create new debug_info */ 693 /* create new debug_info */
694 694
@@ -702,7 +702,7 @@ out:
702 if (!rc){ 702 if (!rc){
703 printk(KERN_ERR "debug: debug_register failed for %s\n",name); 703 printk(KERN_ERR "debug: debug_register failed for %s\n",name);
704 } 704 }
705 up(&debug_lock); 705 mutex_unlock(&debug_mutex);
706 return rc; 706 return rc;
707} 707}
708 708
@@ -716,9 +716,9 @@ debug_unregister(debug_info_t * id)
716{ 716{
717 if (!id) 717 if (!id)
718 goto out; 718 goto out;
719 down(&debug_lock); 719 mutex_lock(&debug_mutex);
720 debug_info_put(id); 720 debug_info_put(id);
721 up(&debug_lock); 721 mutex_unlock(&debug_mutex);
722 722
723out: 723out:
724 return; 724 return;
@@ -1054,11 +1054,11 @@ __init debug_init(void)
1054 int rc = 0; 1054 int rc = 0;
1055 1055
1056 s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table); 1056 s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
1057 down(&debug_lock); 1057 mutex_lock(&debug_mutex);
1058 debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL); 1058 debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
1059 printk(KERN_INFO "debug: Initialization complete\n"); 1059 printk(KERN_INFO "debug: Initialization complete\n");
1060 initialized = 1; 1060 initialized = 1;
1061 up(&debug_lock); 1061 mutex_unlock(&debug_mutex);
1062 1062
1063 return rc; 1063 return rc;
1064} 1064}