diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-01 15:08:29 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-01 15:08:29 +0200 |
| commit | c04fc970e5d9b0c82ae2923af88ad870a74608af (patch) | |
| tree | 2404ba05751397f5dcdc67e8275783147e22e469 /rsnix/src/fat.rs | |
| parent | CONTEXT.md: runtime device detection milestone + QEMU hotplug testability notes (diff) | |
| download | rs-dos-c04fc970e5d9b0c82ae2923af88ad870a74608af.tar.gz rs-dos-c04fc970e5d9b0c82ae2923af88ad870a74608af.zip | |
rsnix: formatting
Diffstat (limited to '')
| -rw-r--r-- | rsnix/src/fat.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rsnix/src/fat.rs b/rsnix/src/fat.rs index ef75aa9..bad01cd 100644 --- a/rsnix/src/fat.rs +++ b/rsnix/src/fat.rs | |||
| @@ -34,8 +34,8 @@ pub struct Entry { | |||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | struct Volume { | 36 | struct Volume { |
| 37 | disk: usize, // AHCI disk index this volume was mounted from | 37 | disk: usize, // AHCI disk index this volume was mounted from |
| 38 | uid: String, // unique mount name: "LABEL-XXXXXXXX" | 38 | uid: String, // unique mount name: "LABEL-XXXXXXXX" |
| 39 | mounted: bool, // still backed by a present disk (false = tombstoned) | 39 | mounted: bool, // still backed by a present disk (false = tombstoned) |
| 40 | sectors_per_cluster: u8, | 40 | sectors_per_cluster: u8, |
| 41 | reserved: u16, | 41 | reserved: u16, |
| @@ -217,7 +217,11 @@ fn is_eoc(c: u32) -> bool { | |||
| 217 | 217 | ||
| 218 | fn next_cluster(c: u32) -> Result<u32, ()> { | 218 | fn next_cluster(c: u32) -> Result<u32, ()> { |
| 219 | let n = read_fat_entry(c); | 219 | let n = read_fat_entry(c); |
| 220 | if is_eoc(n) { Err(()) } else { Ok(n) } | 220 | if is_eoc(n) { |
| 221 | Err(()) | ||
| 222 | } else { | ||
| 223 | Ok(n) | ||
| 224 | } | ||
| 221 | } | 225 | } |
| 222 | 226 | ||
| 223 | /// Allocate a fresh cluster: mark it EOC in the FAT and zero its data. | 227 | /// Allocate a fresh cluster: mark it EOC in the FAT and zero its data. |
