diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index f84cce42fc58..f0640d7f800f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1149,13 +1149,10 @@ void init_request_from_bio(struct request *req, struct bio *bio) | |||
1149 | else | 1149 | else |
1150 | req->cmd_flags |= bio->bi_rw & REQ_FAILFAST_MASK; | 1150 | req->cmd_flags |= bio->bi_rw & REQ_FAILFAST_MASK; |
1151 | 1151 | ||
1152 | if (unlikely(bio_rw_flagged(bio, BIO_RW_DISCARD))) { | 1152 | if (bio_rw_flagged(bio, BIO_RW_DISCARD)) |
1153 | req->cmd_flags |= REQ_DISCARD; | 1153 | req->cmd_flags |= REQ_DISCARD; |
1154 | if (bio_rw_flagged(bio, BIO_RW_BARRIER)) | 1154 | if (bio_rw_flagged(bio, BIO_RW_BARRIER)) |
1155 | req->cmd_flags |= REQ_SOFTBARRIER; | ||
1156 | } else if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) | ||
1157 | req->cmd_flags |= REQ_HARDBARRIER; | 1155 | req->cmd_flags |= REQ_HARDBARRIER; |
1158 | |||
1159 | if (bio_rw_flagged(bio, BIO_RW_SYNCIO)) | 1156 | if (bio_rw_flagged(bio, BIO_RW_SYNCIO)) |
1160 | req->cmd_flags |= REQ_RW_SYNC; | 1157 | req->cmd_flags |= REQ_RW_SYNC; |
1161 | if (bio_rw_flagged(bio, BIO_RW_META)) | 1158 | if (bio_rw_flagged(bio, BIO_RW_META)) |
@@ -1586,7 +1583,7 @@ void submit_bio(int rw, struct bio *bio) | |||
1586 | * If it's a regular read/write or a barrier with data attached, | 1583 | * If it's a regular read/write or a barrier with data attached, |
1587 | * go through the normal accounting stuff before submission. | 1584 | * go through the normal accounting stuff before submission. |
1588 | */ | 1585 | */ |
1589 | if (bio_has_data(bio)) { | 1586 | if (bio_has_data(bio) && !(rw & (1 << BIO_RW_DISCARD))) { |
1590 | if (rw & WRITE) { | 1587 | if (rw & WRITE) { |
1591 | count_vm_events(PGPGOUT, count); | 1588 | count_vm_events(PGPGOUT, count); |
1592 | } else { | 1589 | } else { |