Commit a9c701e594669dd49fed448c27c64f20cfacc8a7

Authored by Jens Axboe
1 parent 7a67f63b32

block: use bio_has_data() to check for data carrying bio

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Showing 2 changed files with 2 additions and 5 deletions Side-by-side Diff

... ... @@ -1490,10 +1490,7 @@
1490 1490 * If it's a regular read/write or a barrier with data attached,
1491 1491 * go through the normal accounting stuff before submission.
1492 1492 */
1493   - if (!bio_empty_barrier(bio)) {
1494   -
1495   - BIO_BUG_ON(!bio->bi_size);
1496   - BIO_BUG_ON(!bio->bi_io_vec);
  1493 + if (bio_has_data(bio)) {
1497 1494  
1498 1495 if (rw & WRITE) {
1499 1496 count_vm_events(PGPGOUT, count);
... ... @@ -185,7 +185,7 @@
185 185 #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
186 186 #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
187 187 #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
188   -#define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size)
  188 +#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio))
189 189  
190 190 static inline unsigned int bio_cur_sectors(struct bio *bio)
191 191 {