summaryrefslogtreecommitdiff
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2014-12-31 13:23:00 +0000
committerJens Axboe <axboe@fb.com>2015-01-02 15:07:49 -0700
commitaf65aa8ea78b296857f257bdc52338d03101813b (patch)
tree45de5c84ceb1a93c6d3b8057e28206dfc2a67f42 /drivers/block/loop.c
parentcf655d953422c846558a320ac9b3c8e659b68275 (diff)
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>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 018af27256c5..185a86d73c3f 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -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;
}