aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-05-02 03:20:30 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-05-02 09:50:28 -0400
commit1553556067cd759f4fae8410bdaad33f5add78cc (patch)
treefbd61741c3b747ebadd45ef9151604105f374352
parente5d709bb5fb758281b5a5dbda50823bb68b3a066 (diff)
s390/memory hotplug,sclp: get rid of per memory increment usecount
Given that the memory block size is always larger or equal to the memory increment size there is no need for a usecount anymore. Each memory increment belongs to exactly one memory block. So get rid of the usecount. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/char/sclp_cmd.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 178836ec252b..bf07c3a188d4 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -345,7 +345,6 @@ struct memory_increment {
345 struct list_head list; 345 struct list_head list;
346 u16 rn; 346 u16 rn;
347 int standby; 347 int standby;
348 int usecount;
349}; 348};
350 349
351struct assign_storage_sccb { 350struct assign_storage_sccb {
@@ -463,21 +462,10 @@ static int sclp_mem_change_state(unsigned long start, unsigned long size,
463 break; 462 break;
464 if (start > istart + rzm - 1) 463 if (start > istart + rzm - 1)
465 continue; 464 continue;
466 if (online) { 465 if (online)
467 if (incr->usecount++)
468 continue;
469 /*
470 * Don't break the loop if one assign fails. Loop may
471 * be walked again on CANCEL and we can't save
472 * information if state changed before or not.
473 * So continue and increase usecount for all increments.
474 */
475 rc |= sclp_assign_storage(incr->rn); 466 rc |= sclp_assign_storage(incr->rn);
476 } else { 467 else
477 if (--incr->usecount)
478 continue;
479 sclp_unassign_storage(incr->rn); 468 sclp_unassign_storage(incr->rn);
480 }
481 } 469 }
482 return rc ? -EIO : 0; 470 return rc ? -EIO : 0;
483} 471}
@@ -561,8 +549,6 @@ static void __init sclp_add_standby_memory(void)
561 add_memory_merged(0); 549 add_memory_merged(0);
562} 550}
563 551
564#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS)
565
566static void __init insert_increment(u16 rn, int standby, int assigned) 552static void __init insert_increment(u16 rn, int standby, int assigned)
567{ 553{
568 struct memory_increment *incr, *new_incr; 554 struct memory_increment *incr, *new_incr;
@@ -574,8 +560,6 @@ static void __init insert_increment(u16 rn, int standby, int assigned)
574 return; 560 return;
575 new_incr->rn = rn; 561 new_incr->rn = rn;
576 new_incr->standby = standby; 562 new_incr->standby = standby;
577 if (!standby)
578 new_incr->usecount = rzm > MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE : 1;
579 last_rn = 0; 563 last_rn = 0;
580 prev = &sclp_mem_list; 564 prev = &sclp_mem_list;
581 list_for_each_entry(incr, &sclp_mem_list, list) { 565 list_for_each_entry(incr, &sclp_mem_list, list) {