提交 0f1ca65e 编写于 作者: A Arianna Avanzini 提交者: Konrad Rzeszutek Wilk

xen, blkfront: factor out flush-related checks from do_blkif_request()

This commit factors out some checks related to the request insertion
path, which can be done in an function instead of by itself.
Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: NArianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 61cecca8
......@@ -582,6 +582,14 @@ static inline void flush_requests(struct blkfront_info *info)
notify_remote_via_irq(info->irq);
}
static inline bool blkif_request_flush_valid(struct request *req,
struct blkfront_info *info)
{
return ((req->cmd_type != REQ_TYPE_FS) ||
((req->cmd_flags & (REQ_FLUSH | REQ_FUA)) &&
!info->flush_op));
}
/*
* do_blkif_request
* read a block; request is in a request queue
......@@ -604,9 +612,7 @@ static void do_blkif_request(struct request_queue *rq)
blk_start_request(req);
if ((req->cmd_type != REQ_TYPE_FS) ||
((req->cmd_flags & (REQ_FLUSH | REQ_FUA)) &&
!info->flush_op)) {
if (blkif_request_flush_valid(req, info)) {
__blk_end_request_all(req, -EIO);
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册