mount: add support for fsck
authorAlan Cox <alan@linux.intel.com>
Sun, 22 Oct 2017 22:31:26 +0000 (23:31 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 22 Oct 2017 22:31:26 +0000 (23:31 +0100)
commitf9a27d62f5c8cba0c668d8f770be583345f20246
tree2828a76a220f75c20d3d1b47feed16f064132b14
parent8f74d5a0d7d8972475c68fd76bf643105551c61a
mount: add support for fsck

- Dirty/clean status handling
- Write back superblocks when we go clean but not if we are clean (or bad)
- Add full checks so remount ro works for all cases

This allows you to fsck -a `prtroot` in /etc/rc to recover the system if
needed. Before rebooting you need to remount filesystems r/o or unmount them.

This last bit wants wiring into reboot so it does a runlevel change to init
unless -f is used. We can then umount everything nicely (by adding umount -a)
and remount the rootfs r/o as well as doing a killall etc when we shutdown.
Kernel/filesys.c
Kernel/include/kernel.h
Kernel/inode.c
Kernel/syscall_other.c