diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-08-08 05:04:44 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:00 -0400 |
commit | a9c701e594669dd49fed448c27c64f20cfacc8a7 (patch) | |
tree | f5524a3612ccbfa758a2b9808111297d7ba17698 | |
parent | 7a67f63b3233ff28e753854fe27891c44f8588ae (diff) |
block: use bio_has_data() to check for data carrying bio
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/blk-core.c | 5 | ||||
-rw-r--r-- | include/linux/bio.h | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 2cba5ef97b2b..54e442ba44aa 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1490,10 +1490,7 @@ void submit_bio(int rw, struct bio *bio) | |||
1490 | * If it's a regular read/write or a barrier with data attached, | 1490 | * If it's a regular read/write or a barrier with data attached, |
1491 | * go through the normal accounting stuff before submission. | 1491 | * go through the normal accounting stuff before submission. |
1492 | */ | 1492 | */ |
1493 | if (!bio_empty_barrier(bio)) { | 1493 | if (bio_has_data(bio)) { |
1494 | |||
1495 | BIO_BUG_ON(!bio->bi_size); | ||
1496 | BIO_BUG_ON(!bio->bi_io_vec); | ||
1497 | 1494 | ||
1498 | if (rw & WRITE) { | 1495 | if (rw & WRITE) { |
1499 | count_vm_events(PGPGOUT, count); | 1496 | count_vm_events(PGPGOUT, count); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 9e93c9299479..dbeb66f813ab 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -185,7 +185,7 @@ struct bio { | |||
185 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 185 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
186 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 186 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
187 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | 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 | static inline unsigned int bio_cur_sectors(struct bio *bio) | 190 | static inline unsigned int bio_cur_sectors(struct bio *bio) |
191 | { | 191 | { |