diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/paride/pd.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index ae4971e5d9a8..0ff9b12d0e35 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -242,6 +242,11 @@ struct pd_unit { | |||
242 | 242 | ||
243 | static struct pd_unit pd[PD_UNITS]; | 243 | static struct pd_unit pd[PD_UNITS]; |
244 | 244 | ||
245 | struct pd_req { | ||
246 | /* for REQ_OP_DRV_IN: */ | ||
247 | enum action (*func)(struct pd_unit *disk); | ||
248 | }; | ||
249 | |||
245 | static char pd_scratch[512]; /* scratch block buffer */ | 250 | static char pd_scratch[512]; /* scratch block buffer */ |
246 | 251 | ||
247 | static char *pd_errs[17] = { "ERR", "INDEX", "ECC", "DRQ", "SEEK", "WRERR", | 252 | static char *pd_errs[17] = { "ERR", "INDEX", "ECC", "DRQ", "SEEK", "WRERR", |
@@ -502,8 +507,9 @@ static enum action do_pd_io_start(void) | |||
502 | 507 | ||
503 | static enum action pd_special(void) | 508 | static enum action pd_special(void) |
504 | { | 509 | { |
505 | enum action (*func)(struct pd_unit *) = pd_req->special; | 510 | struct pd_req *req = blk_mq_rq_to_pdu(pd_req); |
506 | return func(pd_current); | 511 | |
512 | return req->func(pd_current); | ||
507 | } | 513 | } |
508 | 514 | ||
509 | static int pd_next_buf(void) | 515 | static int pd_next_buf(void) |
@@ -767,12 +773,14 @@ static int pd_special_command(struct pd_unit *disk, | |||
767 | enum action (*func)(struct pd_unit *disk)) | 773 | enum action (*func)(struct pd_unit *disk)) |
768 | { | 774 | { |
769 | struct request *rq; | 775 | struct request *rq; |
776 | struct pd_req *req; | ||
770 | 777 | ||
771 | rq = blk_get_request(disk->gd->queue, REQ_OP_DRV_IN, 0); | 778 | rq = blk_get_request(disk->gd->queue, REQ_OP_DRV_IN, 0); |
772 | if (IS_ERR(rq)) | 779 | if (IS_ERR(rq)) |
773 | return PTR_ERR(rq); | 780 | return PTR_ERR(rq); |
781 | req = blk_mq_rq_to_pdu(rq); | ||
774 | 782 | ||
775 | rq->special = func; | 783 | req->func = func; |
776 | blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); | 784 | blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); |
777 | blk_put_request(rq); | 785 | blk_put_request(rq); |
778 | return 0; | 786 | return 0; |
@@ -892,9 +900,21 @@ static void pd_probe_drive(struct pd_unit *disk) | |||
892 | disk->gd = p; | 900 | disk->gd = p; |
893 | p->private_data = disk; | 901 | p->private_data = disk; |
894 | 902 | ||
895 | p->queue = blk_mq_init_sq_queue(&disk->tag_set, &pd_mq_ops, 2, | 903 | memset(&disk->tag_set, 0, sizeof(disk->tag_set)); |
896 | BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING); | 904 | disk->tag_set.ops = &pd_mq_ops; |
905 | disk->tag_set.cmd_size = sizeof(struct pd_req); | ||
906 | disk->tag_set.nr_hw_queues = 1; | ||
907 | disk->tag_set.nr_maps = 1; | ||
908 | disk->tag_set.queue_depth = 2; | ||
909 | disk->tag_set.numa_node = NUMA_NO_NODE; | ||
910 | disk->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING; | ||
911 | |||
912 | if (blk_mq_alloc_tag_set(&disk->tag_set)) | ||
913 | return; | ||
914 | |||
915 | p->queue = blk_mq_init_queue(&disk->tag_set); | ||
897 | if (IS_ERR(p->queue)) { | 916 | if (IS_ERR(p->queue)) { |
917 | blk_mq_free_tag_set(&disk->tag_set); | ||
898 | p->queue = NULL; | 918 | p->queue = NULL; |
899 | return; | 919 | return; |
900 | } | 920 | } |