]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: sparse support: enable automatic sparsifying of files on SSDs
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 30 Nov 2023 21:36:35 +0000 (22:36 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 30 Nov 2023 21:37:35 +0000 (22:37 +0100)
Given that SSDs don't have a seek penalty, we can enable
automatic sparsifying of files on SSDs, even if the "sparse"
mount option is not set.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/local_includes/path.h
winsup/cygwin/release/3.5.0
winsup/doc/new-features.xml
winsup/doc/utils.xml

index c7f113f8746a2bb4011bda7f83d6cb8a11ca4a34..d19721e0cd3f2095744719c1417e22c94d252f9e 100644 (file)
@@ -174,8 +174,8 @@ class path_conv
   bool isgood_inode (ino_t ino) const;
   bool support_sparse () const
   {
-    return (mount_flags & MOUNT_SPARSE)
-          && (fs_flags () & FILE_SUPPORTS_SPARSE_FILES);
+    return (fs_flags () & FILE_SUPPORTS_SPARSE_FILES)
+          && (fs.is_ssd () || (mount_flags & MOUNT_SPARSE));
   }
   int has_dos_filenames_only () const {return mount_flags & MOUNT_DOS;}
   int has_buggy_reopen () const {return fs.has_buggy_reopen ();}
index 3b6df951d4d399b139fe55b43e47c1787234ae5c..d0a6c2fc830281c993211e71eae6e65817cf4b0e 100644 (file)
@@ -55,3 +55,6 @@ What changed:
   https://www.austingroupbugs.net/view.php?id=1674
 
 - FIFOs now also work over NFS.
+
+- Enable automatic sparsifying of files on SSDs, independent of the
+  "sparse" mount mode.
index c5e6cdd7f2dcfcc959ca9e3a79af90742f2b9298..56509bdc38cfcdea635a1aec0514e861831ed691 100644 (file)
@@ -82,6 +82,11 @@ New API call: fallocate (Linux-specific).
 FIFOs now also work over NFS.
 </para></listitem>
 
+<listitem><para>
+Enable automatic sparsifying of files on SSDs, independent of the
+"sparse" mount mode.
+</para></listitem>
+
 </itemizedlist>
 
 </sect2>
index ad17c979663f75bcec371039187886cbe855ebb8..f79a928df2c7f29b7d1d0c926fae1ab4eed1b956 100644 (file)
@@ -1933,6 +1933,7 @@ D: on /d type fat (binary,user,noumount)
                (default).
   sparse     - Switch on support for sparse files.  This option only makes
                sense on NTFS and then only if you really need sparse files.
+              This flag is always silently enabled on SSD drives.
   text       - Files default to CRLF text mode line endings.
 </screen>
 
This page took 0.039679 seconds and 5 git commands to generate.