This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -606,6 +606,26 @@ void __init mount_root(char *root_device_name)
606
606
}
607
607
}
608
608
609
+ /* wait for any asynchronous scanning to complete */
610
+ static void __init wait_for_root (char * root_device_name )
611
+ {
612
+ if (ROOT_DEV != 0 )
613
+ return ;
614
+
615
+ pr_info ("Waiting for root device %s...\n" , root_device_name );
616
+
617
+ for (;;) {
618
+ if (driver_probe_done ()) {
619
+ ROOT_DEV = name_to_dev_t (root_device_name );
620
+ if (ROOT_DEV )
621
+ break ;
622
+ }
623
+ msleep (5 );
624
+ }
625
+ async_synchronize_full ();
626
+
627
+ }
628
+
609
629
static dev_t __init parse_root_device (char * root_device_name )
610
630
{
611
631
if (!strncmp (root_device_name , "mtd" , 3 ) ||
@@ -642,16 +662,8 @@ void __init prepare_namespace(void)
642
662
if (initrd_load (saved_root_name ))
643
663
goto out ;
644
664
645
- /* wait for any asynchronous scanning to complete */
646
- if ((ROOT_DEV == 0 ) && root_wait ) {
647
- printk (KERN_INFO "Waiting for root device %s...\n" ,
648
- saved_root_name );
649
- while (!driver_probe_done () ||
650
- (ROOT_DEV = name_to_dev_t (saved_root_name )) == 0 )
651
- msleep (5 );
652
- async_synchronize_full ();
653
- }
654
-
665
+ if (root_wait )
666
+ wait_for_root (saved_root_name );
655
667
mount_root (saved_root_name );
656
668
out :
657
669
devtmpfs_mount ();
You can’t perform that action at this time.
0 commit comments