@@ -91,7 +91,7 @@ static inline struct r10bio *get_resync_r10bio(struct bio *bio)
91
91
static void * r10bio_pool_alloc (gfp_t gfp_flags , void * data )
92
92
{
93
93
struct r10conf * conf = data ;
94
- int size = offsetof(struct r10bio , devs [conf -> geo . raid_disks ]);
94
+ int size = offsetof(struct r10bio , devs [conf -> copies ]);
95
95
96
96
/* allocate a r10bio with room for raid_disks entries in the
97
97
* bios array */
@@ -238,7 +238,7 @@ static void put_all_bios(struct r10conf *conf, struct r10bio *r10_bio)
238
238
{
239
239
int i ;
240
240
241
- for (i = 0 ; i < conf -> geo . raid_disks ; i ++ ) {
241
+ for (i = 0 ; i < conf -> copies ; i ++ ) {
242
242
struct bio * * bio = & r10_bio -> devs [i ].bio ;
243
243
if (!BIO_SPECIAL (* bio ))
244
244
bio_put (* bio );
@@ -327,7 +327,7 @@ static int find_bio_disk(struct r10conf *conf, struct r10bio *r10_bio,
327
327
int slot ;
328
328
int repl = 0 ;
329
329
330
- for (slot = 0 ; slot < conf -> geo . raid_disks ; slot ++ ) {
330
+ for (slot = 0 ; slot < conf -> copies ; slot ++ ) {
331
331
if (r10_bio -> devs [slot ].bio == bio )
332
332
break ;
333
333
if (r10_bio -> devs [slot ].repl_bio == bio ) {
@@ -336,6 +336,7 @@ static int find_bio_disk(struct r10conf *conf, struct r10bio *r10_bio,
336
336
}
337
337
}
338
338
339
+ BUG_ON (slot == conf -> copies );
339
340
update_head_pos (slot , r10_bio );
340
341
341
342
if (slotp )
@@ -1492,7 +1493,7 @@ static void __make_request(struct mddev *mddev, struct bio *bio, int sectors)
1492
1493
r10_bio -> mddev = mddev ;
1493
1494
r10_bio -> sector = bio -> bi_iter .bi_sector ;
1494
1495
r10_bio -> state = 0 ;
1495
- memset (r10_bio -> devs , 0 , sizeof (r10_bio -> devs [0 ]) * conf -> geo . raid_disks );
1496
+ memset (r10_bio -> devs , 0 , sizeof (r10_bio -> devs [0 ]) * conf -> copies );
1496
1497
1497
1498
if (bio_data_dir (bio ) == READ )
1498
1499
raid10_read_request (mddev , bio , r10_bio );
0 commit comments