Exemple #1
0
/*===========================================================================*
 *				unmount_all				     *
 *===========================================================================*/
void unmount_all(int force)
{
/* Unmount all filesystems.  File systems are mounted on other file systems,
 * so you have to pull off the loose bits repeatedly to get it all undone.
 */

  int i;
  struct vmnt *vmp;

  /* Now unmount the rest */
  for (i = 0; i < NR_MNTS; i++) {
	/* Unmount at least one. */
	for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) {
		if (vmp->m_dev != NO_DEV)
			unmount(vmp->m_dev, NULL);
	}
  }

  if (!force) return;

  /* Verify nothing is locked anymore */
  check_vnode_locks();
  check_vmnt_locks();
  check_filp_locks();
  check_bsf_lock();

  /* Verify we succesfully unmounted all file systems */
  for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) {
	if (vmp->m_dev != NO_DEV) {
		panic("vmp still mounted: %s %d %d\n", vmp->m_label,
			vmp->m_fs_e, vmp->m_dev);
	}
  }
}
Exemple #2
0
/*===========================================================================*
 *				unmount_all				     *
 *===========================================================================*/
PUBLIC void unmount_all(void)
{
/* Unmount all filesystems.  File systems are mounted on other file systems,
 * so you have to pull off the loose bits repeatedly to get it all undone.
 */

  int i;
  struct vmnt *vmp;

  /* Now unmount the rest */
  for (i = 0; i < NR_MNTS; i++) {
	/* Unmount at least one. */
	for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; vmp++) {
		if (vmp->m_dev != NO_DEV)
			unmount(vmp->m_dev, NULL);
	}
  }
  check_vnode_locks();
  check_vmnt_locks();
  check_filp_locks();
  check_bsf_lock();
}