| 973 | } |
| 974 | |
| 975 | static void |
| 976 | vfs_mountroot_wait(void) |
| 977 | { |
| 978 | struct root_hold_token *h; |
| 979 | struct timeval lastfail; |
| 980 | int curfail; |
| 981 | |
| 982 | TSENTER(); |
| 983 | |
| 984 | curfail = 0; |
| 985 | while (1) { |
| 986 | g_waitidle(); |
| 987 | mtx_lock(&root_holds_mtx); |
| 988 | if (TAILQ_EMPTY(&root_holds)) { |
| 989 | mtx_unlock(&root_holds_mtx); |
| 990 | break; |
| 991 | } |
| 992 | if (ppsratecheck(&lastfail, &curfail, 1)) { |
| 993 | printf("Root mount waiting for:"); |
| 994 | TAILQ_FOREACH(h, &root_holds, list) |
| 995 | printf(" %s", h->who); |
| 996 | printf("\n"); |
| 997 | } |
| 998 | TSWAIT("root mount"); |
| 999 | msleep(&root_holds, &root_holds_mtx, PZERO | PDROP, "roothold", |
| 1000 | hz); |
| 1001 | TSUNWAIT("root mount"); |
| 1002 | } |
| 1003 | |
| 1004 | TSEXIT(); |
| 1005 | } |
| 1006 | |
| 1007 | static int |
| 1008 | vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev) |
no test coverage detected