diff options
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 14 |
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) | |||
459 | pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset; | 459 | pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset; |
460 | 460 | ||
461 | if (rq->cmd_flags & REQ_WRITE) { | 461 | if (rq->cmd_flags & REQ_WRITE) { |
462 | |||
463 | if (rq->cmd_flags & REQ_FLUSH) | 462 | if (rq->cmd_flags & REQ_FLUSH) |
464 | ret = lo_req_flush(lo, rq); | 463 | ret = lo_req_flush(lo, rq); |
465 | 464 | else if (rq->cmd_flags & REQ_DISCARD) | |
466 | if (rq->cmd_flags & REQ_DISCARD) { | ||
467 | ret = lo_discard(lo, rq, pos); | 465 | ret = lo_discard(lo, rq, pos); |
468 | goto out; | 466 | else |
469 | } | 467 | ret = lo_send(lo, rq, pos); |
470 | |||
471 | ret = lo_send(lo, rq, pos); | ||
472 | |||
473 | if ((rq->cmd_flags & REQ_FUA) && !ret) | ||
474 | ret = lo_req_flush(lo, rq); | ||
475 | } else | 468 | } else |
476 | ret = lo_receive(lo, rq, lo->lo_blocksize, pos); | 469 | ret = lo_receive(lo, rq, lo->lo_blocksize, pos); |
477 | 470 | ||
478 | out: | ||
479 | return ret; | 471 | return ret; |
480 | } | 472 | } |
481 | 473 | ||