block: remove BIO_BUG_ON
authorChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 16:17:57 +0000 (18:17 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:34 +0000 (06:17 -0600)
BIO_DEBUG is always defined, so just switch the two instances to use
BUG_ON directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211012161804.991559-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/bio.h

index a6fb6a0b429550d0559924afac6cb7326b2669d2..35b875563c8bac48ff4f1f406271ced6f168cf21 100644 (file)
@@ -156,7 +156,7 @@ out:
 
 void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs)
 {
-       BIO_BUG_ON(nr_vecs > BIO_MAX_VECS);
+       BUG_ON(nr_vecs > BIO_MAX_VECS);
 
        if (nr_vecs == BIO_MAX_VECS)
                mempool_free(bv, pool);
@@ -677,7 +677,7 @@ static void bio_alloc_cache_destroy(struct bio_set *bs)
 void bio_put(struct bio *bio)
 {
        if (unlikely(bio_flagged(bio, BIO_REFFED))) {
-               BIO_BUG_ON(!atomic_read(&bio->__bi_cnt));
+               BUG_ON(!atomic_read(&bio->__bi_cnt));
                if (!atomic_dec_and_test(&bio->__bi_cnt))
                        return;
        }
index 00952e92eae1b1062bb2ffe91920df9af827cfec..65a356fa71109e6ec9d8c1a0cc3c50fd7b3460db 100644 (file)
 #include <linux/blk_types.h>
 #include <linux/uio.h>
 
-#define BIO_DEBUG
-
-#ifdef BIO_DEBUG
-#define BIO_BUG_ON     BUG_ON
-#else
-#define BIO_BUG_ON
-#endif
-
 #define BIO_MAX_VECS           256U
 
 static inline unsigned int bio_max_segs(unsigned int nr_segs)