summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blk-core.c5
-rw-r--r--include/linux/bio.h2
2 files changed, 2 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 2cba5ef97b2..54e442ba44a 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1490,10 +1490,7 @@ void submit_bio(int rw, struct bio *bio)
* If it's a regular read/write or a barrier with data attached,
* go through the normal accounting stuff before submission.
*/
- if (!bio_empty_barrier(bio)) {
-
- BIO_BUG_ON(!bio->bi_size);
- BIO_BUG_ON(!bio->bi_io_vec);
+ if (bio_has_data(bio)) {
if (rw & WRITE) {
count_vm_events(PGPGOUT, count);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 9e93c929947..dbeb66f813a 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -185,7 +185,7 @@ struct bio {
#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
-#define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size)
+#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio))
static inline unsigned int bio_cur_sectors(struct bio *bio)
{