Discussion:
disk defragmentation
(too old to reply)
muta...@gmail.com
2022-10-16 04:46:15 UTC
Permalink
I don't suppose there is already a bit, or a bit could
be used, in the FAT directory to say that a file is
contiguous such that you don't need to go through
the cluster chains to seek, you can instead go
directly to the required sector, given the start
cluster?

BFN. Paul.
Alexei A. Frounze
2022-10-16 05:50:52 UTC
Permalink
Post by ***@gmail.com
I don't suppose there is already a bit, or a bit could
be used, in the FAT directory to say that a file is
contiguous such that you don't need to go through
the cluster chains to seek, you can instead go
directly to the required sector, given the start
cluster?
There's unused space, which you could use for it, but doing so
may introduce incompatibility with other software.

Using magic timestamps or making them more coarse
(to encode the bit in there) is similarly problematic.

OTOH, you could cache portions of the FAT or even cluster chains.

Also, if you cache just the middle cluster number for a file,
you can speed the chain traversal by a factor of two (you effectively
halve the file for the purpose of seeking).

Additional on-disk metadata is OK, but you need to keep it in sync
with the rest of the FS and at this point it's probably better to
switch to a journaled FS and abandon FAT altogether.

Alex

Loading...