block: loop: don't handle REQ_FUA explicitly
block core handles REQ_FUA by its flush state machine, so won't do it in loop explicitly. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Родитель
cf655d9534
Коммит
af65aa8ea7
|
@ -459,23 +459,15 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
|
|||
pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;
|
||||
|
||||
if (rq->cmd_flags & REQ_WRITE) {
|
||||
|
||||
if (rq->cmd_flags & REQ_FLUSH)
|
||||
ret = lo_req_flush(lo, rq);
|
||||
|
||||
if (rq->cmd_flags & REQ_DISCARD) {
|
||||
else if (rq->cmd_flags & REQ_DISCARD)
|
||||
ret = lo_discard(lo, rq, pos);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = lo_send(lo, rq, pos);
|
||||
|
||||
if ((rq->cmd_flags & REQ_FUA) && !ret)
|
||||
ret = lo_req_flush(lo, rq);
|
||||
else
|
||||
ret = lo_send(lo, rq, pos);
|
||||
} else
|
||||
ret = lo_receive(lo, rq, lo->lo_blocksize, pos);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче