diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2009-09-11 04:28:29 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-09-11 04:29:41 -0400 |
commit | 68b781fe1bed89011ab7c58ede8476abe64432d2 (patch) | |
tree | afe2148854aa2f4eae370a2cf1855f80a9b5a8cb /drivers/s390/block/dasd.c | |
parent | 97f604b07473669f4da52b1f859ee45e8d48d42a (diff) |
[S390] dasd: optimize cpu usage in goodcase
remove unnecessary dbf call, remove string operations for magic
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index f8445b8ff173..e109da4583a8 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -669,14 +669,14 @@ static void dasd_profile_end(struct dasd_block *block, | |||
669 | * memory and 2) dasd_smalloc_request uses the static ccw memory | 669 | * memory and 2) dasd_smalloc_request uses the static ccw memory |
670 | * that gets allocated for each device. | 670 | * that gets allocated for each device. |
671 | */ | 671 | */ |
672 | struct dasd_ccw_req *dasd_kmalloc_request(char *magic, int cplength, | 672 | struct dasd_ccw_req *dasd_kmalloc_request(int magic, int cplength, |
673 | int datasize, | 673 | int datasize, |
674 | struct dasd_device *device) | 674 | struct dasd_device *device) |
675 | { | 675 | { |
676 | struct dasd_ccw_req *cqr; | 676 | struct dasd_ccw_req *cqr; |
677 | 677 | ||
678 | /* Sanity checks */ | 678 | /* Sanity checks */ |
679 | BUG_ON( magic == NULL || datasize > PAGE_SIZE || | 679 | BUG_ON(datasize > PAGE_SIZE || |
680 | (cplength*sizeof(struct ccw1)) > PAGE_SIZE); | 680 | (cplength*sizeof(struct ccw1)) > PAGE_SIZE); |
681 | 681 | ||
682 | cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC); | 682 | cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC); |
@@ -700,14 +700,13 @@ struct dasd_ccw_req *dasd_kmalloc_request(char *magic, int cplength, | |||
700 | return ERR_PTR(-ENOMEM); | 700 | return ERR_PTR(-ENOMEM); |
701 | } | 701 | } |
702 | } | 702 | } |
703 | strncpy((char *) &cqr->magic, magic, 4); | 703 | cqr->magic = magic; |
704 | ASCEBC((char *) &cqr->magic, 4); | ||
705 | set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); | 704 | set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); |
706 | dasd_get_device(device); | 705 | dasd_get_device(device); |
707 | return cqr; | 706 | return cqr; |
708 | } | 707 | } |
709 | 708 | ||
710 | struct dasd_ccw_req *dasd_smalloc_request(char *magic, int cplength, | 709 | struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, |
711 | int datasize, | 710 | int datasize, |
712 | struct dasd_device *device) | 711 | struct dasd_device *device) |
713 | { | 712 | { |
@@ -717,7 +716,7 @@ struct dasd_ccw_req *dasd_smalloc_request(char *magic, int cplength, | |||
717 | int size; | 716 | int size; |
718 | 717 | ||
719 | /* Sanity checks */ | 718 | /* Sanity checks */ |
720 | BUG_ON( magic == NULL || datasize > PAGE_SIZE || | 719 | BUG_ON(datasize > PAGE_SIZE || |
721 | (cplength*sizeof(struct ccw1)) > PAGE_SIZE); | 720 | (cplength*sizeof(struct ccw1)) > PAGE_SIZE); |
722 | 721 | ||
723 | size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; | 722 | size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; |
@@ -744,8 +743,7 @@ struct dasd_ccw_req *dasd_smalloc_request(char *magic, int cplength, | |||
744 | cqr->data = data; | 743 | cqr->data = data; |
745 | memset(cqr->data, 0, datasize); | 744 | memset(cqr->data, 0, datasize); |
746 | } | 745 | } |
747 | strncpy((char *) &cqr->magic, magic, 4); | 746 | cqr->magic = magic; |
748 | ASCEBC((char *) &cqr->magic, 4); | ||
749 | set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); | 747 | set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); |
750 | dasd_get_device(device); | 748 | dasd_get_device(device); |
751 | return cqr; | 749 | return cqr; |
@@ -899,9 +897,6 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) | |||
899 | switch (rc) { | 897 | switch (rc) { |
900 | case 0: | 898 | case 0: |
901 | cqr->status = DASD_CQR_IN_IO; | 899 | cqr->status = DASD_CQR_IN_IO; |
902 | DBF_DEV_EVENT(DBF_DEBUG, device, | ||
903 | "start_IO: request %p started successful", | ||
904 | cqr); | ||
905 | break; | 900 | break; |
906 | case -EBUSY: | 901 | case -EBUSY: |
907 | DBF_DEV_EVENT(DBF_DEBUG, device, "%s", | 902 | DBF_DEV_EVENT(DBF_DEBUG, device, "%s", |
@@ -2533,7 +2528,7 @@ EXPORT_SYMBOL_GPL(dasd_generic_restore_device); | |||
2533 | static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, | 2528 | static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, |
2534 | void *rdc_buffer, | 2529 | void *rdc_buffer, |
2535 | int rdc_buffer_size, | 2530 | int rdc_buffer_size, |
2536 | char *magic) | 2531 | int magic) |
2537 | { | 2532 | { |
2538 | struct dasd_ccw_req *cqr; | 2533 | struct dasd_ccw_req *cqr; |
2539 | struct ccw1 *ccw; | 2534 | struct ccw1 *ccw; |
@@ -2564,7 +2559,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, | |||
2564 | } | 2559 | } |
2565 | 2560 | ||
2566 | 2561 | ||
2567 | int dasd_generic_read_dev_chars(struct dasd_device *device, char *magic, | 2562 | int dasd_generic_read_dev_chars(struct dasd_device *device, int magic, |
2568 | void *rdc_buffer, int rdc_buffer_size) | 2563 | void *rdc_buffer, int rdc_buffer_size) |
2569 | { | 2564 | { |
2570 | int ret; | 2565 | int ret; |