Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_bio.c
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/asan.h> | #include <sys/asan.h> | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/bitset.h> | #include <sys/bitset.h> | ||||
#include <sys/boottrace.h> | |||||
#include <sys/buf.h> | |||||
#include <sys/conf.h> | #include <sys/conf.h> | ||||
#include <sys/counter.h> | #include <sys/counter.h> | ||||
#include <sys/buf.h> | |||||
#include <sys/devicestat.h> | #include <sys/devicestat.h> | ||||
#include <sys/eventhandler.h> | #include <sys/eventhandler.h> | ||||
#include <sys/fail.h> | #include <sys/fail.h> | ||||
#include <sys/ktr.h> | #include <sys/ktr.h> | ||||
#include <sys/limits.h> | #include <sys/limits.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
▲ Show 20 Lines • Show All 1,379 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (nbusy) { | if (nbusy) { | ||||
/* | /* | ||||
* Failed to sync all blocks. Indicate this and don't | * Failed to sync all blocks. Indicate this and don't | ||||
* unmount filesystems (thus forcing an fsck on reboot). | * unmount filesystems (thus forcing an fsck on reboot). | ||||
*/ | */ | ||||
BOOTTRACE("shutdown failed to sync buffers"); | |||||
printf("Giving up on %d buffers\n", nbusy); | printf("Giving up on %d buffers\n", nbusy); | ||||
DELAY(5000000); /* 5 seconds */ | DELAY(5000000); /* 5 seconds */ | ||||
} else { | } else { | ||||
BOOTTRACE("shutdown sync complete"); | |||||
if (!first_buf_printf) | if (!first_buf_printf) | ||||
printf("Final sync complete\n"); | printf("Final sync complete\n"); | ||||
/* | /* | ||||
* Unmount filesystems | * Unmount filesystems | ||||
*/ | */ | ||||
if (!KERNEL_PANICKED()) | if (!KERNEL_PANICKED()) | ||||
vfs_unmountall(); | vfs_unmountall(); | ||||
BOOTTRACE("shutdown unmounted all filesystems"); | |||||
} | } | ||||
swapoff_all(); | swapoff_all(); | ||||
DELAY(100000); /* wait for console output to finish */ | DELAY(100000); /* wait for console output to finish */ | ||||
} | } | ||||
static void | static void | ||||
bpmap_qenter(struct buf *bp) | bpmap_qenter(struct buf *bp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 4,083 Lines • Show Last 20 Lines |