struct bio *bio;
int try;
- if (!num_bios)
- return;
-
- if (num_bios == 1) {
- bio = alloc_tio(ci, ti, 0, len, GFP_NOIO);
- bio_list_add(blist, bio);
- return;
- }
-
for (try = 0; try < 2; try++) {
int bio_nr;
struct bio_list blist = BIO_EMPTY_LIST;
struct bio *clone;
- alloc_multiple_bios(&blist, ci, ti, num_bios, len);
-
- while ((clone = bio_list_pop(&blist))) {
+ switch (num_bios) {
+ case 0:
+ break;
+ case 1:
+ clone = alloc_tio(ci, ti, 0, len, GFP_NOIO);
if (len)
bio_setup_sector(clone, ci->sector, *len);
__map_bio(clone);
+ break;
+ default:
+ alloc_multiple_bios(&blist, ci, ti, num_bios, len);
+ while ((clone = bio_list_pop(&blist))) {
+ if (len)
+ bio_setup_sector(clone, ci->sector, *len);
+ __map_bio(clone);
+ }
+ break;
}
}