diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2023-04-30 18:44:29 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2023-04-30 18:44:29 +0000 |
commit | d24b5a7a0e45186f13d19ddefde62b0932726e42 (patch) | |
tree | a3cfeee8dd915bbd60e9f6be96c7318f81e1dfd1 /sys/src/cmd/dossrv/dat.h | |
parent | 101b3c2724779fcb0e503ae274abd7b751a3a48f (diff) |
dossrv: Implement support for != 512 sector and track sizes
The iotrack buffer layer always assumed 512 byte sector
size and 9 sectors per track.
To support 4K sector size fats, make the iotrack code
deal with it.
Instead of the fixed size Track structure, we just allocate
the pointers and buffers dynamically, and move the sector
size and tack size in the Xfs structure.
Tracks can still be reused between differnet file-systems
after a purgetrack().
The initial fat header has to be read with devread()
instead of getsect() to determine the sector/track size
of the file-system.
Diffstat (limited to 'sys/src/cmd/dossrv/dat.h')
-rw-r--r-- | sys/src/cmd/dossrv/dat.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/cmd/dossrv/dat.h b/sys/src/cmd/dossrv/dat.h index 80af491b0..7546d229f 100644 --- a/sys/src/cmd/dossrv/dat.h +++ b/sys/src/cmd/dossrv/dat.h @@ -118,7 +118,6 @@ struct Fatinfo */ struct Dosbpb{ MLock; /* access to fat */ - int sectsize; /* in bytes */ int clustsize; /* in sectors */ int nresrv; /* sectors */ int nfats; /* usually 2; modified to 1 if fat mirroring disabled */ @@ -190,7 +189,7 @@ struct Dosptr{ Dosdir *d; }; -#define QIDPATH(p) ((p)->addr*(Sectorsize/DOSDIRSIZE) + \ +#define QIDPATH(p, xf) ((p)->addr*((xf)->sectsize/DOSDIRSIZE) + \ (p)->offset/DOSDIRSIZE) struct Xfs{ @@ -203,6 +202,8 @@ struct Xfs{ uchar isfat32; /* is a fat 32 file system? */ short dev; short fmt; + int sectsize; + int sect2trk; vlong offset; void *ptr; }; |