Skip to content

Commit

Permalink
block: remove BIO_BUG_ON
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Oct 18, 2021
1 parent e9ea159 commit 9e8c0d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void bio_put_slab(struct bio_set *bs)

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);
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 0 additions & 8 deletions include/linux/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
#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)
Expand Down

0 comments on commit 9e8c0d0

Please sign in to comment.