Răsfoiți Sursa

Set the contiguous flag and print a warning if image file is non-contiguous.

Petteri Aimonen 3 ani în urmă
părinte
comite
a2d690c019
2 a modificat fișierele cu 14 adăugiri și 0 ștergeri
  1. 5 0
      README.md
  2. 9 0
      src/AzulSCSI.cpp

+ 5 - 0
README.md

@@ -38,6 +38,11 @@ Performance
 With verbose log messages disabled, expected SCSI performance is 1.7 MB/s read and 1.5 MB/s write.
 Slow SD card or fragmented filesystem can slow down access.
 
+Seek performance is best if image files are contiguous.
+For ExFAT filesystem this relies on a file flag set by PC.
+Current versions of exfat-fuse on Linux have an [issue](https://github.com/relan/exfat/pull/101) that causes the files not to be marked contiguous even when they are.
+This is indicated by message `WARNING: file HD00_512.hda is not contiguous. This will increase read latency.` in the log.
+
 Programming
 -----------
 The AzulSCSI v1 board can be programmed using USB connection in DFU mode.

+ 9 - 0
src/AzulSCSI.cpp

@@ -164,6 +164,15 @@ bool hddimageOpen(HDDIMG *h,const char *image_name,int id,int lun,int blocksize)
     h->m_fileSize = h->m_file.size();
     azlog("Opened image file ", image_name, " fileSize: ", (int)(h->m_fileSize / 1024), " kB");
     
+    if (h->m_file.contiguousRange(NULL, NULL))
+    {
+      azlog("Image file is contiguous.");
+    }
+    else
+    {
+      azlog("WARNING: file ", image_name, " is not contiguous. This will increase read latency.");
+    }
+
     if(h->m_fileSize > 0)
     {
       return true; // File opened