mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-14 20:07:32 +07:00
blk_end_request: changing viocd (take 4)
This patch converts viocd to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. As a result, the interface of internal function, viocd_end_request(), is changed. Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
f530f03637
commit
e935eb9dba
@ -289,7 +289,7 @@ static int send_request(struct request *req)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void viocd_end_request(struct request *req, int uptodate)
|
static void viocd_end_request(struct request *req, int error)
|
||||||
{
|
{
|
||||||
int nsectors = req->hard_nr_sectors;
|
int nsectors = req->hard_nr_sectors;
|
||||||
|
|
||||||
@ -302,11 +302,8 @@ static void viocd_end_request(struct request *req, int uptodate)
|
|||||||
if (!nsectors)
|
if (!nsectors)
|
||||||
nsectors = 1;
|
nsectors = 1;
|
||||||
|
|
||||||
if (end_that_request_first(req, uptodate, nsectors))
|
if (__blk_end_request(req, error, nsectors << 9))
|
||||||
BUG();
|
BUG();
|
||||||
add_disk_randomness(req->rq_disk);
|
|
||||||
blkdev_dequeue_request(req);
|
|
||||||
end_that_request_last(req, uptodate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rwreq;
|
static int rwreq;
|
||||||
@ -317,11 +314,11 @@ static void do_viocd_request(struct request_queue *q)
|
|||||||
|
|
||||||
while ((rwreq == 0) && ((req = elv_next_request(q)) != NULL)) {
|
while ((rwreq == 0) && ((req = elv_next_request(q)) != NULL)) {
|
||||||
if (!blk_fs_request(req))
|
if (!blk_fs_request(req))
|
||||||
viocd_end_request(req, 0);
|
viocd_end_request(req, -EIO);
|
||||||
else if (send_request(req) < 0) {
|
else if (send_request(req) < 0) {
|
||||||
printk(VIOCD_KERN_WARNING
|
printk(VIOCD_KERN_WARNING
|
||||||
"unable to send message to OS/400!");
|
"unable to send message to OS/400!");
|
||||||
viocd_end_request(req, 0);
|
viocd_end_request(req, -EIO);
|
||||||
} else
|
} else
|
||||||
rwreq++;
|
rwreq++;
|
||||||
}
|
}
|
||||||
@ -532,9 +529,9 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
|
|||||||
"with rc %d:0x%04X: %s\n",
|
"with rc %d:0x%04X: %s\n",
|
||||||
req, event->xRc,
|
req, event->xRc,
|
||||||
bevent->sub_result, err->msg);
|
bevent->sub_result, err->msg);
|
||||||
viocd_end_request(req, 0);
|
viocd_end_request(req, -EIO);
|
||||||
} else
|
} else
|
||||||
viocd_end_request(req, 1);
|
viocd_end_request(req, 0);
|
||||||
|
|
||||||
/* restart handling of incoming requests */
|
/* restart handling of incoming requests */
|
||||||
spin_unlock_irqrestore(&viocd_reqlock, flags);
|
spin_unlock_irqrestore(&viocd_reqlock, flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user