@@ -574,6 +574,18 @@ static void multipath_release_clone(struct request *clone,
574
574
* Map cloned bios (bio-based multipath)
575
575
*/
576
576
577
+ static void multipath_queue_bio (struct multipath * m , struct bio * bio )
578
+ {
579
+ unsigned long flags ;
580
+
581
+ /* Queue for the daemon to resubmit */
582
+ spin_lock_irqsave (& m -> lock , flags );
583
+ bio_list_add (& m -> queued_bios , bio );
584
+ if (!test_bit (MPATHF_QUEUE_IO , & m -> flags ))
585
+ queue_work (kmultipathd , & m -> process_queued_bios );
586
+ spin_unlock_irqrestore (& m -> lock , flags );
587
+ }
588
+
577
589
static struct pgpath * __map_bio (struct multipath * m , struct bio * bio )
578
590
{
579
591
struct pgpath * pgpath ;
@@ -590,16 +602,11 @@ static struct pgpath *__map_bio(struct multipath *m, struct bio *bio)
590
602
591
603
if ((pgpath && queue_io ) ||
592
604
(!pgpath && test_bit (MPATHF_QUEUE_IF_NO_PATH , & m -> flags ))) {
593
- /* Queue for the daemon to resubmit */
594
- spin_lock_irqsave (& m -> lock , flags );
595
- bio_list_add (& m -> queued_bios , bio );
596
- spin_unlock_irqrestore (& m -> lock , flags );
605
+ multipath_queue_bio (m , bio );
597
606
598
607
/* PG_INIT_REQUIRED cannot be set without QUEUE_IO */
599
608
if (queue_io || test_bit (MPATHF_PG_INIT_REQUIRED , & m -> flags ))
600
609
pg_init_all_paths (m );
601
- else if (!queue_io )
602
- queue_work (kmultipathd , & m -> process_queued_bios );
603
610
604
611
return ERR_PTR (- EAGAIN );
605
612
}
@@ -1678,12 +1685,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
1678
1685
spin_unlock_irqrestore (& m -> lock , flags );
1679
1686
}
1680
1687
1681
- spin_lock_irqsave (& m -> lock , flags );
1682
- bio_list_add (& m -> queued_bios , clone );
1683
- if (!test_bit (MPATHF_QUEUE_IO , & m -> flags ))
1684
- queue_work (kmultipathd , & m -> process_queued_bios );
1685
- spin_unlock_irqrestore (& m -> lock , flags );
1686
-
1688
+ multipath_queue_bio (m , clone );
1687
1689
r = DM_ENDIO_INCOMPLETE ;
1688
1690
done :
1689
1691
if (pgpath ) {
0 commit comments