]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
block: use bio_has_data() to check for data carrying bio
authorJens Axboe <jens.axboe@oracle.com>
Fri, 8 Aug 2008 09:04:44 +0000 (11:04 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:00 +0000 (08:56 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-core.c
include/linux/bio.h

index 2cba5ef97b2b3a6d49559c8923a87e1ec128c2fa..54e442ba44aa14ef6c1c72234586c1e3db28e282 100644 (file)
@@ -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);
index 9e93c9299479054aa0273ff65b144c6f161b4719..dbeb66f813abc01f3fe89b12697d7927ae304649 100644 (file)
@@ -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)
 {