BUG_ON() Conversion in md/raid10.c
this changes if() BUG(); constructs to BUG_ON() which is cleaner and can better optimized away Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
committed by
Adrian Bunk
parent
43dab9bbe9
commit
b638548384
@@ -1117,8 +1117,7 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error)
|
|||||||
for (i=0; i<conf->copies; i++)
|
for (i=0; i<conf->copies; i++)
|
||||||
if (r10_bio->devs[i].bio == bio)
|
if (r10_bio->devs[i].bio == bio)
|
||||||
break;
|
break;
|
||||||
if (i == conf->copies)
|
BUG_ON(i == conf->copies);
|
||||||
BUG();
|
|
||||||
update_head_pos(i, r10_bio);
|
update_head_pos(i, r10_bio);
|
||||||
d = r10_bio->devs[i].devnum;
|
d = r10_bio->devs[i].devnum;
|
||||||
|
|
||||||
@@ -1518,8 +1517,7 @@ static int init_resync(conf_t *conf)
|
|||||||
int buffs;
|
int buffs;
|
||||||
|
|
||||||
buffs = RESYNC_WINDOW / RESYNC_BLOCK_SIZE;
|
buffs = RESYNC_WINDOW / RESYNC_BLOCK_SIZE;
|
||||||
if (conf->r10buf_pool)
|
BUG_ON(conf->r10buf_pool);
|
||||||
BUG();
|
|
||||||
conf->r10buf_pool = mempool_create(buffs, r10buf_pool_alloc, r10buf_pool_free, conf);
|
conf->r10buf_pool = mempool_create(buffs, r10buf_pool_alloc, r10buf_pool_free, conf);
|
||||||
if (!conf->r10buf_pool)
|
if (!conf->r10buf_pool)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Reference in New Issue
Block a user