diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-07-15 15:21:45 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:21:45 -0400 |
commit | d79c5a670ddf076a346ddcf3d9e21785ecab963f (patch) | |
tree | 6024094cecb13f2b0cd2c4edaeb5f53c6aa6d273 /drivers/block | |
parent | ed820f19521de246c5b7978f8f78290733a55b20 (diff) |
block: convert pd_special_command to use blk_execute_rq
pd_special_command uses blk_put_request with struct request on the
stack. As a result, blk_put_request needs a hack to catch a NULL
request_queue. This converts pd_special_command to use
blk_execute_rq.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/paride/pd.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 570f3b70dce7..5fdfa7c888ce 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -712,19 +712,17 @@ static void do_pd_request(struct request_queue * q) | |||
712 | static int pd_special_command(struct pd_unit *disk, | 712 | static int pd_special_command(struct pd_unit *disk, |
713 | enum action (*func)(struct pd_unit *disk)) | 713 | enum action (*func)(struct pd_unit *disk)) |
714 | { | 714 | { |
715 | DECLARE_COMPLETION_ONSTACK(wait); | 715 | struct request *rq; |
716 | struct request rq; | ||
717 | int err = 0; | 716 | int err = 0; |
718 | 717 | ||
719 | blk_rq_init(NULL, &rq); | 718 | rq = blk_get_request(disk->gd->queue, READ, __GFP_WAIT); |
720 | rq.rq_disk = disk->gd; | 719 | |
721 | rq.end_io_data = &wait; | 720 | rq->cmd_type = REQ_TYPE_SPECIAL; |
722 | rq.end_io = blk_end_sync_rq; | 721 | rq->special = func; |
723 | blk_insert_request(disk->gd->queue, &rq, 0, func); | 722 | |
724 | wait_for_completion(&wait); | 723 | err = blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); |
725 | if (rq.errors) | 724 | |
726 | err = -EIO; | 725 | blk_put_request(rq); |
727 | blk_put_request(&rq); | ||
728 | return err; | 726 | return err; |
729 | } | 727 | } |
730 | 728 | ||