Commit 248fffb
committed
imagedev/floppy: batch sequential flux writes
Some floppy controllers commit generated write flux in very small spans.
This is especially visible while formatting, where a controller can emit a
full track byte-by-byte and each byte-level commit previously edited the
persistent track vector immediately. That turns one logical sequential track
write into thousands of repeated track scans and insertions, making format
operations orders of magnitude slower than the emulated disk timing.
Keep the existing write path semantics by delaying only contiguous writes to
the same cylinder, side and subcylinder. The accumulated span is flushed
before any operation that can observe or depend on committed media state,
including cache fills, write-splice updates and image commit. Non-contiguous
writes or writes to another track also flush first, so existing callers that
issue isolated writes continue to take the same path with no behavioral
change beyond avoiding redundant intermediate vector edits.
The pending span stores the original start/end positions and concatenated
flux-change positions, then reuses the existing wspan_remove_damaged and
wspan_write helpers when flushed. This preserves the existing damaged-region
handling and track modification logic while making sequential write streams
behave like the single larger write they represent.1 parent 4810ca9 commit 248fffb
2 files changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| |||
498 | 504 | | |
499 | 505 | | |
500 | 506 | | |
| 507 | + | |
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
| |||
649 | 656 | | |
650 | 657 | | |
651 | 658 | | |
| 659 | + | |
| 660 | + | |
652 | 661 | | |
653 | 662 | | |
654 | 663 | | |
| |||
1125 | 1134 | | |
1126 | 1135 | | |
1127 | 1136 | | |
| 1137 | + | |
1128 | 1138 | | |
1129 | 1139 | | |
1130 | 1140 | | |
| |||
1234 | 1244 | | |
1235 | 1245 | | |
1236 | 1246 | | |
1237 | | - | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1238 | 1277 | | |
| 1278 | + | |
1239 | 1279 | | |
1240 | 1280 | | |
1241 | 1281 | | |
| |||
1244 | 1284 | | |
1245 | 1285 | | |
1246 | 1286 | | |
| 1287 | + | |
1247 | 1288 | | |
1248 | 1289 | | |
1249 | 1290 | | |
| |||
1370 | 1411 | | |
1371 | 1412 | | |
1372 | 1413 | | |
| 1414 | + | |
1373 | 1415 | | |
1374 | 1416 | | |
1375 | 1417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
0 commit comments