* Unmount all filesystems. The list is traversed in reverse order * of mounting to avoid dependencies. */
| 4708 | * of mounting to avoid dependencies. |
| 4709 | */ |
| 4710 | void |
| 4711 | vfs_unmountall(void) |
| 4712 | { |
| 4713 | struct mount *mp, *tmp; |
| 4714 | |
| 4715 | CTR1(KTR_VFS, "%s: unmounting all filesystems", __func__); |
| 4716 | |
| 4717 | /* |
| 4718 | * Since this only runs when rebooting, it is not interlocked. |
| 4719 | */ |
| 4720 | TAILQ_FOREACH_REVERSE_SAFE(mp, &mountlist, mntlist, mnt_list, tmp) { |
| 4721 | vfs_ref(mp); |
| 4722 | |
| 4723 | /* |
| 4724 | * Forcibly unmounting "/dev" before "/" would prevent clean |
| 4725 | * unmount of the latter. |
| 4726 | */ |
| 4727 | if (mp == rootdevmp) |
| 4728 | continue; |
| 4729 | |
| 4730 | unmount_or_warn(mp); |
| 4731 | } |
| 4732 | |
| 4733 | if (rootdevmp != NULL) |
| 4734 | unmount_or_warn(rootdevmp); |
| 4735 | } |
| 4736 | |
| 4737 | static void |
| 4738 | vfs_deferred_inactive(struct vnode *vp, int lkflags) |
no test coverage detected