Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af65aa8e authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

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: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent cf655d95
Loading
Loading
Loading
Loading
+3 −11
Original line number Original line Diff line number Diff line
@@ -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;
	pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;


	if (rq->cmd_flags & REQ_WRITE) {
	if (rq->cmd_flags & REQ_WRITE) {

		if (rq->cmd_flags & REQ_FLUSH)
		if (rq->cmd_flags & REQ_FLUSH)
			ret = lo_req_flush(lo, rq);
			ret = lo_req_flush(lo, rq);

		else if (rq->cmd_flags & REQ_DISCARD)
		if (rq->cmd_flags & REQ_DISCARD) {
			ret = lo_discard(lo, rq, pos);
			ret = lo_discard(lo, rq, pos);
			goto out;
		else
		}

			ret = lo_send(lo, rq, pos);
			ret = lo_send(lo, rq, pos);

		if ((rq->cmd_flags & REQ_FUA) && !ret)
			ret = lo_req_flush(lo, rq);
	} else
	} else
		ret = lo_receive(lo, rq, lo->lo_blocksize, pos);
		ret = lo_receive(lo, rq, lo->lo_blocksize, pos);


out:
	return ret;
	return ret;
}
}