aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/mm/extmem.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/s390/mm/extmem.c b/arch/s390/mm/extmem.c
index 375c2c4f6b77..9e9bc48463a5 100644
--- a/arch/s390/mm/extmem.c
+++ b/arch/s390/mm/extmem.c
@@ -78,7 +78,7 @@ struct dcss_segment {
78 int segcnt; 78 int segcnt;
79}; 79};
80 80
81static DEFINE_SPINLOCK(dcss_lock); 81static DEFINE_MUTEX(dcss_lock);
82static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list); 82static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list);
83static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC", 83static char *segtype_string[] = { "SW", "EW", "SR", "ER", "SN", "EN", "SC",
84 "EW/EN-MIXED" }; 84 "EW/EN-MIXED" };
@@ -114,7 +114,7 @@ segment_by_name (char *name)
114 struct list_head *l; 114 struct list_head *l;
115 struct dcss_segment *tmp, *retval = NULL; 115 struct dcss_segment *tmp, *retval = NULL;
116 116
117 assert_spin_locked(&dcss_lock); 117 BUG_ON(!mutex_is_locked(&dcss_lock));
118 dcss_mkname (name, dcss_name); 118 dcss_mkname (name, dcss_name);
119 list_for_each (l, &dcss_list) { 119 list_for_each (l, &dcss_list) {
120 tmp = list_entry (l, struct dcss_segment, list); 120 tmp = list_entry (l, struct dcss_segment, list);
@@ -269,7 +269,7 @@ segment_overlaps_others (struct dcss_segment *seg)
269 struct list_head *l; 269 struct list_head *l;
270 struct dcss_segment *tmp; 270 struct dcss_segment *tmp;
271 271
272 assert_spin_locked(&dcss_lock); 272 BUG_ON(!mutex_is_locked(&dcss_lock));
273 list_for_each(l, &dcss_list) { 273 list_for_each(l, &dcss_list) {
274 tmp = list_entry(l, struct dcss_segment, list); 274 tmp = list_entry(l, struct dcss_segment, list);
275 if ((tmp->start_addr >> 20) > (seg->end >> 20)) 275 if ((tmp->start_addr >> 20) > (seg->end >> 20))
@@ -426,7 +426,7 @@ segment_load (char *name, int do_nonshared, unsigned long *addr,
426 if (!MACHINE_IS_VM) 426 if (!MACHINE_IS_VM)
427 return -ENOSYS; 427 return -ENOSYS;
428 428
429 spin_lock (&dcss_lock); 429 mutex_lock(&dcss_lock);
430 seg = segment_by_name (name); 430 seg = segment_by_name (name);
431 if (seg == NULL) 431 if (seg == NULL)
432 rc = __segment_load (name, do_nonshared, addr, end); 432 rc = __segment_load (name, do_nonshared, addr, end);
@@ -441,7 +441,7 @@ segment_load (char *name, int do_nonshared, unsigned long *addr,
441 rc = -EPERM; 441 rc = -EPERM;
442 } 442 }
443 } 443 }
444 spin_unlock (&dcss_lock); 444 mutex_unlock(&dcss_lock);
445 return rc; 445 return rc;
446} 446}
447 447
@@ -464,7 +464,7 @@ segment_modify_shared (char *name, int do_nonshared)
464 unsigned long dummy; 464 unsigned long dummy;
465 int dcss_command, rc, diag_cc; 465 int dcss_command, rc, diag_cc;
466 466
467 spin_lock (&dcss_lock); 467 mutex_lock(&dcss_lock);
468 seg = segment_by_name (name); 468 seg = segment_by_name (name);
469 if (seg == NULL) { 469 if (seg == NULL) {
470 rc = -EINVAL; 470 rc = -EINVAL;
@@ -505,7 +505,7 @@ segment_modify_shared (char *name, int do_nonshared)
505 &dummy, &dummy); 505 &dummy, &dummy);
506 kfree(seg); 506 kfree(seg);
507 out_unlock: 507 out_unlock:
508 spin_unlock(&dcss_lock); 508 mutex_unlock(&dcss_lock);
509 return rc; 509 return rc;
510} 510}
511 511
@@ -523,7 +523,7 @@ segment_unload(char *name)
523 if (!MACHINE_IS_VM) 523 if (!MACHINE_IS_VM)
524 return; 524 return;
525 525
526 spin_lock(&dcss_lock); 526 mutex_lock(&dcss_lock);
527 seg = segment_by_name (name); 527 seg = segment_by_name (name);
528 if (seg == NULL) { 528 if (seg == NULL) {
529 PRINT_ERR ("could not find segment %s in segment_unload, " 529 PRINT_ERR ("could not find segment %s in segment_unload, "
@@ -537,7 +537,7 @@ segment_unload(char *name)
537 kfree(seg); 537 kfree(seg);
538 } 538 }
539out_unlock: 539out_unlock:
540 spin_unlock(&dcss_lock); 540 mutex_unlock(&dcss_lock);
541} 541}
542 542
543/* 543/*
@@ -556,7 +556,7 @@ segment_save(char *name)
556 if (!MACHINE_IS_VM) 556 if (!MACHINE_IS_VM)
557 return; 557 return;
558 558
559 spin_lock(&dcss_lock); 559 mutex_lock(&dcss_lock);
560 seg = segment_by_name (name); 560 seg = segment_by_name (name);
561 561
562 if (seg == NULL) { 562 if (seg == NULL) {
@@ -589,7 +589,7 @@ segment_save(char *name)
589 goto out; 589 goto out;
590 } 590 }
591out: 591out:
592 spin_unlock(&dcss_lock); 592 mutex_unlock(&dcss_lock);
593} 593}
594 594
595EXPORT_SYMBOL(segment_load); 595EXPORT_SYMBOL(segment_load);