From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 179413870C34; Thu, 30 Nov 2023 21:40:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 179413870C34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1701380415; bh=SqlhZF2op+prPTPNKqdT7VCl88PvkhMVekTCQLZqfDw=; h=From:To:Subject:Date:From; b=s1RKTqBv5AvRStPk7MgNlUBZzqHhO+gG7GwbR44naqw+atd22Rfos2SQJWsEWhAqY OHVpJCKUelWkaqvZxxQIs6DgAC4bOho4vgE+Qtr7iXU4kGxpdgO/TMx404eRJvI27w jq1c+pegruZBI8kxnTX8y6BJuYaQSyiZ6OaIPTaI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: sparse support: enable automatic sparsifying of files on SSDs X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 8b01c5d6903fbcbb14c52db45c12494b53493c5a X-Git-Newrev: 832e91422c4ae9b2dcd0c307779f3dd53ee9c0ac Message-Id: <20231130214015.179413870C34@sourceware.org> Date: Thu, 30 Nov 2023 21:40:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D832e91422c4= ae9b2dcd0c307779f3dd53ee9c0ac commit 832e91422c4ae9b2dcd0c307779f3dd53ee9c0ac Author: Corinna Vinschen AuthorDate: Thu Nov 30 22:36:35 2023 +0100 Commit: Corinna Vinschen CommitDate: Thu Nov 30 22:37:35 2023 +0100 Cygwin: sparse support: enable automatic sparsifying of files on SSDs =20 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. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/local_includes/path.h | 4 ++-- winsup/cygwin/release/3.5.0 | 3 +++ winsup/doc/new-features.xml | 5 +++++ winsup/doc/utils.xml | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/local_includes/path.h b/winsup/cygwin/local_incl= udes/path.h index c7f113f8746a..d19721e0cd3f 100644 --- a/winsup/cygwin/local_includes/path.h +++ b/winsup/cygwin/local_includes/path.h @@ -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 ();} diff --git a/winsup/cygwin/release/3.5.0 b/winsup/cygwin/release/3.5.0 index 3b6df951d4d3..d0a6c2fc8302 100644 --- a/winsup/cygwin/release/3.5.0 +++ b/winsup/cygwin/release/3.5.0 @@ -55,3 +55,6 @@ What changed: https://www.austingroupbugs.net/view.php?id=3D1674 =20 - FIFOs now also work over NFS. + +- Enable automatic sparsifying of files on SSDs, independent of the + "sparse" mount mode. diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index c5e6cdd7f2dc..56509bdc38cf 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -82,6 +82,11 @@ New API call: fallocate (Linux-specific). FIFOs now also work over NFS. =20 + +Enable automatic sparsifying of files on SSDs, independent of the +"sparse" mount mode. + + =20 diff --git a/winsup/doc/utils.xml b/winsup/doc/utils.xml index ad17c979663f..f79a928df2c7 100644 --- a/winsup/doc/utils.xml +++ b/winsup/doc/utils.xml @@ -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.