[FASTFAT] Completely rewrite support for dirty volumes.
authorPierre Schweitzer <pierre@reactos.org>
Fri, 18 May 2018 21:00:13 +0000 (23:00 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Fri, 18 May 2018 21:05:05 +0000 (23:05 +0200)
commit7c015876805c99d0c2d979133d1ce653f9393ed3
treeda38bb8158420c492aa6f7e8d3fa349aac178d3f
parentefa75dd5b2eaf8f9298e30ee8bb01884dc2731e5
[FASTFAT] Completely rewrite support for dirty volumes.

Until now, our support for dirty volumes was totally broken
to a point where, on FAT32 volume, the dirty couldn't even
be written nor read from the disk.

This commit totally rewrites its handling, for both FAT16 and FAT32
so that it's now fully functionnal. Furthermore, it also gets
totally compatible with our vfatlib, and thus, autochk.
Now, on mount, FastFAT will check if the volume is dirty or not, and
autochk will be able to ask for a repair if dirty. vfatlib will
repair the volume and remove the dirty bit. So that, on next
reboot, the volume will be mounted clean.

As a reminder, the dirty bit is set immediately after mounting
the volume, so that, if you crash or have a powercut, autochk
will always attempt to repair your volume (with more or less,
that's FAT!).

If you want to experience without breaking your FAT volume,
just boot, open a cmd prompt and type: fsutil dirty set c:
and reboot!

CORE-13758
CORE-13760
CORE-13759
drivers/filesystems/fastfat/blockdev.c
drivers/filesystems/fastfat/fat.c
drivers/filesystems/fastfat/fsctl.c
drivers/filesystems/fastfat/shutdown.c
drivers/filesystems/fastfat/vfat.h