diff options
author | Jens Axboe <axboe@kernel.dk> | 2013-11-01 12:38:45 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-11-08 11:10:29 -0500 |
commit | 6a5ec65b9acee39f9af4a15a81858d5fc07498d0 (patch) | |
tree | eb86de09e70c7c76b432087e810ca9e282fbe266 /drivers/block/skd_main.c | |
parent | fcd37eb3c1347193935d07a82b84dfc7d418dd05 (diff) |
skd: cleanup the skd_*() function block wrapping
Just call the block functions directly, don't wrap them
in skd helpers. With only one queueing model enabled, there's
no point in doing that.
Also kill the ->start_time and ->bio from the skd_request_context,
we don't use those anymore.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/skd_main.c')
-rw-r--r-- | drivers/block/skd_main.c | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 49e1e8b48422..d404d7646d9c 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c | |||
@@ -214,8 +214,6 @@ struct skd_request_context { | |||
214 | u32 fitmsg_id; | 214 | u32 fitmsg_id; |
215 | 215 | ||
216 | struct request *req; | 216 | struct request *req; |
217 | struct bio *bio; | ||
218 | unsigned long start_time; | ||
219 | u8 flush_cmd; | 217 | u8 flush_cmd; |
220 | u8 discard_page; | 218 | u8 discard_page; |
221 | 219 | ||
@@ -506,26 +504,6 @@ static void skd_log_skreq(struct skd_device *skdev, | |||
506 | * READ/WRITE REQUESTS | 504 | * READ/WRITE REQUESTS |
507 | ***************************************************************************** | 505 | ***************************************************************************** |
508 | */ | 506 | */ |
509 | static void skd_stop_queue(struct skd_device *skdev) | ||
510 | { | ||
511 | blk_stop_queue(skdev->queue); | ||
512 | } | ||
513 | |||
514 | static void skd_unstop_queue(struct skd_device *skdev) | ||
515 | { | ||
516 | queue_flag_clear(QUEUE_FLAG_STOPPED, skdev->queue); | ||
517 | } | ||
518 | |||
519 | static void skd_start_queue(struct skd_device *skdev) | ||
520 | { | ||
521 | blk_start_queue(skdev->queue); | ||
522 | } | ||
523 | |||
524 | static int skd_queue_stopped(struct skd_device *skdev) | ||
525 | { | ||
526 | return blk_queue_stopped(skdev->queue); | ||
527 | } | ||
528 | |||
529 | static void skd_fail_all_pending(struct skd_device *skdev) | 507 | static void skd_fail_all_pending(struct skd_device *skdev) |
530 | { | 508 | { |
531 | struct request_queue *q = skdev->queue; | 509 | struct request_queue *q = skdev->queue; |
@@ -634,14 +612,14 @@ static void skd_request_fn(struct request_queue *q) | |||
634 | return; | 612 | return; |
635 | } | 613 | } |
636 | 614 | ||
637 | if (skd_queue_stopped(skdev)) { | 615 | if (blk_queue_stopped(skdev->queue)) { |
638 | if (skdev->skmsg_free_list == NULL || | 616 | if (skdev->skmsg_free_list == NULL || |
639 | skdev->skreq_free_list == NULL || | 617 | skdev->skreq_free_list == NULL || |
640 | skdev->in_flight >= skdev->queue_low_water_mark) | 618 | skdev->in_flight >= skdev->queue_low_water_mark) |
641 | /* There is still some kind of shortage */ | 619 | /* There is still some kind of shortage */ |
642 | return; | 620 | return; |
643 | 621 | ||
644 | skd_unstop_queue(skdev); | 622 | queue_flag_clear(QUEUE_FLAG_STOPPED, skdev->queue); |
645 | } | 623 | } |
646 | 624 | ||
647 | /* | 625 | /* |
@@ -887,7 +865,7 @@ skip_sg: | |||
887 | * we are out of a resource. | 865 | * we are out of a resource. |
888 | */ | 866 | */ |
889 | if (req) | 867 | if (req) |
890 | skd_stop_queue(skdev); | 868 | blk_stop_queue(skdev->queue); |
891 | } | 869 | } |
892 | 870 | ||
893 | static void skd_end_request_blk(struct skd_device *skdev, | 871 | static void skd_end_request_blk(struct skd_device *skdev, |
@@ -1106,7 +1084,7 @@ static void skd_timer_tick(ulong arg) | |||
1106 | skdev->timer_countdown = SKD_DRAINING_TIMO; | 1084 | skdev->timer_countdown = SKD_DRAINING_TIMO; |
1107 | skdev->state = SKD_DRVR_STATE_DRAINING_TIMEOUT; | 1085 | skdev->state = SKD_DRVR_STATE_DRAINING_TIMEOUT; |
1108 | skdev->timo_slot = timo_slot; | 1086 | skdev->timo_slot = timo_slot; |
1109 | skd_stop_queue(skdev); | 1087 | blk_stop_queue(skdev->queue); |
1110 | 1088 | ||
1111 | timer_func_out: | 1089 | timer_func_out: |
1112 | mod_timer(&skdev->timer, (jiffies + HZ)); | 1090 | mod_timer(&skdev->timer, (jiffies + HZ)); |
@@ -1165,7 +1143,7 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) | |||
1165 | 1143 | ||
1166 | /*start the queue so we can respond with error to requests */ | 1144 | /*start the queue so we can respond with error to requests */ |
1167 | /* wakeup anyone waiting for startup complete */ | 1145 | /* wakeup anyone waiting for startup complete */ |
1168 | skd_start_queue(skdev); | 1146 | blk_start_queue(skdev->queue); |
1169 | skdev->gendisk_on = -1; | 1147 | skdev->gendisk_on = -1; |
1170 | wake_up_interruptible(&skdev->waitq); | 1148 | wake_up_interruptible(&skdev->waitq); |
1171 | break; | 1149 | break; |
@@ -1191,7 +1169,7 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) | |||
1191 | pr_debug("%s:%s:%d Slot drained, starting queue.\n", | 1169 | pr_debug("%s:%s:%d Slot drained, starting queue.\n", |
1192 | skdev->name, __func__, __LINE__); | 1170 | skdev->name, __func__, __LINE__); |
1193 | skdev->state = SKD_DRVR_STATE_ONLINE; | 1171 | skdev->state = SKD_DRVR_STATE_ONLINE; |
1194 | skd_start_queue(skdev); | 1172 | blk_start_queue(skdev->queue); |
1195 | return; | 1173 | return; |
1196 | } | 1174 | } |
1197 | if (skdev->timer_countdown > 0) { | 1175 | if (skdev->timer_countdown > 0) { |
@@ -1241,7 +1219,7 @@ static void skd_timer_tick_not_online(struct skd_device *skdev) | |||
1241 | 1219 | ||
1242 | /*start the queue so we can respond with error to requests */ | 1220 | /*start the queue so we can respond with error to requests */ |
1243 | /* wakeup anyone waiting for startup complete */ | 1221 | /* wakeup anyone waiting for startup complete */ |
1244 | skd_start_queue(skdev); | 1222 | blk_start_queue(skdev->queue); |
1245 | skdev->gendisk_on = -1; | 1223 | skdev->gendisk_on = -1; |
1246 | wake_up_interruptible(&skdev->waitq); | 1224 | wake_up_interruptible(&skdev->waitq); |
1247 | break; | 1225 | break; |
@@ -3241,7 +3219,7 @@ static void skd_isr_fwstate(struct skd_device *skdev) | |||
3241 | */ | 3219 | */ |
3242 | skdev->state = SKD_DRVR_STATE_BUSY_SANITIZE; | 3220 | skdev->state = SKD_DRVR_STATE_BUSY_SANITIZE; |
3243 | skdev->timer_countdown = SKD_TIMER_SECONDS(3); | 3221 | skdev->timer_countdown = SKD_TIMER_SECONDS(3); |
3244 | skd_start_queue(skdev); | 3222 | blk_start_queue(skdev->queue); |
3245 | break; | 3223 | break; |
3246 | case FIT_SR_DRIVE_BUSY_ERASE: | 3224 | case FIT_SR_DRIVE_BUSY_ERASE: |
3247 | skdev->state = SKD_DRVR_STATE_BUSY_ERASE; | 3225 | skdev->state = SKD_DRVR_STATE_BUSY_ERASE; |
@@ -3276,7 +3254,7 @@ static void skd_isr_fwstate(struct skd_device *skdev) | |||
3276 | case FIT_SR_DRIVE_FAULT: | 3254 | case FIT_SR_DRIVE_FAULT: |
3277 | skd_drive_fault(skdev); | 3255 | skd_drive_fault(skdev); |
3278 | skd_recover_requests(skdev, 0); | 3256 | skd_recover_requests(skdev, 0); |
3279 | skd_start_queue(skdev); | 3257 | blk_start_queue(skdev->queue); |
3280 | break; | 3258 | break; |
3281 | 3259 | ||
3282 | /* PCIe bus returned all Fs? */ | 3260 | /* PCIe bus returned all Fs? */ |
@@ -3285,7 +3263,7 @@ static void skd_isr_fwstate(struct skd_device *skdev) | |||
3285 | skd_name(skdev), state, sense); | 3263 | skd_name(skdev), state, sense); |
3286 | skd_drive_disappeared(skdev); | 3264 | skd_drive_disappeared(skdev); |
3287 | skd_recover_requests(skdev, 0); | 3265 | skd_recover_requests(skdev, 0); |
3288 | skd_start_queue(skdev); | 3266 | blk_start_queue(skdev->queue); |
3289 | break; | 3267 | break; |
3290 | default: | 3268 | default: |
3291 | /* | 3269 | /* |
@@ -3609,7 +3587,7 @@ static void skd_start_device(struct skd_device *skdev) | |||
3609 | /*start the queue so we can respond with error to requests */ | 3587 | /*start the queue so we can respond with error to requests */ |
3610 | pr_debug("%s:%s:%d starting %s queue\n", | 3588 | pr_debug("%s:%s:%d starting %s queue\n", |
3611 | skdev->name, __func__, __LINE__, skdev->name); | 3589 | skdev->name, __func__, __LINE__, skdev->name); |
3612 | skd_start_queue(skdev); | 3590 | blk_start_queue(skdev->queue); |
3613 | skdev->gendisk_on = -1; | 3591 | skdev->gendisk_on = -1; |
3614 | wake_up_interruptible(&skdev->waitq); | 3592 | wake_up_interruptible(&skdev->waitq); |
3615 | break; | 3593 | break; |
@@ -3621,7 +3599,7 @@ static void skd_start_device(struct skd_device *skdev) | |||
3621 | /*start the queue so we can respond with error to requests */ | 3599 | /*start the queue so we can respond with error to requests */ |
3622 | pr_debug("%s:%s:%d starting %s queue to error-out reqs\n", | 3600 | pr_debug("%s:%s:%d starting %s queue to error-out reqs\n", |
3623 | skdev->name, __func__, __LINE__, skdev->name); | 3601 | skdev->name, __func__, __LINE__, skdev->name); |
3624 | skd_start_queue(skdev); | 3602 | blk_start_queue(skdev->queue); |
3625 | skdev->gendisk_on = -1; | 3603 | skdev->gendisk_on = -1; |
3626 | wake_up_interruptible(&skdev->waitq); | 3604 | wake_up_interruptible(&skdev->waitq); |
3627 | break; | 3605 | break; |
@@ -3766,7 +3744,7 @@ static int skd_quiesce_dev(struct skd_device *skdev) | |||
3766 | case SKD_DRVR_STATE_BUSY_IMMINENT: | 3744 | case SKD_DRVR_STATE_BUSY_IMMINENT: |
3767 | pr_debug("%s:%s:%d stopping %s queue\n", | 3745 | pr_debug("%s:%s:%d stopping %s queue\n", |
3768 | skdev->name, __func__, __LINE__, skdev->name); | 3746 | skdev->name, __func__, __LINE__, skdev->name); |
3769 | skd_stop_queue(skdev); | 3747 | blk_stop_queue(skdev->queue); |
3770 | break; | 3748 | break; |
3771 | case SKD_DRVR_STATE_ONLINE: | 3749 | case SKD_DRVR_STATE_ONLINE: |
3772 | case SKD_DRVR_STATE_STOPPING: | 3750 | case SKD_DRVR_STATE_STOPPING: |
@@ -3835,7 +3813,7 @@ static int skd_unquiesce_dev(struct skd_device *skdev) | |||
3835 | pr_debug("%s:%s:%d starting %s queue\n", | 3813 | pr_debug("%s:%s:%d starting %s queue\n", |
3836 | skdev->name, __func__, __LINE__, skdev->name); | 3814 | skdev->name, __func__, __LINE__, skdev->name); |
3837 | pr_info("(%s): STEC s1120 ONLINE\n", skd_name(skdev)); | 3815 | pr_info("(%s): STEC s1120 ONLINE\n", skd_name(skdev)); |
3838 | skd_start_queue(skdev); | 3816 | blk_start_queue(skdev->queue); |
3839 | skdev->gendisk_on = 1; | 3817 | skdev->gendisk_on = 1; |
3840 | wake_up_interruptible(&skdev->waitq); | 3818 | wake_up_interruptible(&skdev->waitq); |
3841 | break; | 3819 | break; |
@@ -4620,7 +4598,7 @@ static int skd_cons_disk(struct skd_device *skdev) | |||
4620 | spin_lock_irqsave(&skdev->lock, flags); | 4598 | spin_lock_irqsave(&skdev->lock, flags); |
4621 | pr_debug("%s:%s:%d stopping %s queue\n", | 4599 | pr_debug("%s:%s:%d stopping %s queue\n", |
4622 | skdev->name, __func__, __LINE__, skdev->name); | 4600 | skdev->name, __func__, __LINE__, skdev->name); |
4623 | skd_stop_queue(skdev); | 4601 | blk_stop_queue(skdev->queue); |
4624 | spin_unlock_irqrestore(&skdev->lock, flags); | 4602 | spin_unlock_irqrestore(&skdev->lock, flags); |
4625 | 4603 | ||
4626 | err_out: | 4604 | err_out: |