public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: fs_info: update filesystem flags and check Windows 7 flags Date: Mon, 20 Mar 2023 11:58:29 +0000 (GMT) [thread overview] Message-ID: <20230320115829.8936A3858C74@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=fcccdc4021ffbe86c5ea6bb3b5c64b95c98f4ed4 commit fcccdc4021ffbe86c5ea6bb3b5c64b95c98f4ed4 Author: Corinna Vinschen <corinna@vinschen.de> AuthorDate: Mon Mar 20 12:22:07 2023 +0100 Commit: Corinna Vinschen <corinna@vinschen.de> CommitDate: Mon Mar 20 12:55:30 2023 +0100 Cygwin: fs_info: update filesystem flags and check Windows 7 flags Update the list of filesystem flags to the flags supported since Windows 7. Make sure to use the new flags only with Windows filesystems, not with 3rd party filesystems. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- winsup/cygwin/local_includes/winlean.h | 23 +++++++++++++ winsup/cygwin/mount.cc | 60 +++++++++++++++++++++++++++++----- 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/local_includes/winlean.h b/winsup/cygwin/local_includes/winlean.h index 9b30b6557c4f..113b2c6b0d3f 100644 --- a/winsup/cygwin/local_includes/winlean.h +++ b/winsup/cygwin/local_includes/winlean.h @@ -74,6 +74,29 @@ details. */ #undef CRITICAL #endif +/* Filesystem flags not yet supported by Mingw-w64 headers. */ +#ifndef FILE_RETURNS_CLEANUP_RESULT_INFO +#define FILE_RETURNS_CLEANUP_RESULT_INFO 0x00000200 +#endif +#ifndef FILE_SUPPORTS_POSIX_UNLINK_RENAME +#define FILE_SUPPORTS_POSIX_UNLINK_RENAME 0x00000400 +#endif +#ifndef FILE_SUPPORTS_INTEGRITY_STREAMS +#define FILE_SUPPORTS_INTEGRITY_STREAMS 0x04000000 +#endif +#ifndef FILE_SUPPORTS_BLOCK_REFCOUNTING +#define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000 +#endif +#ifndef FILE_SUPPORTS_SPARSE_VDL +#define FILE_SUPPORTS_SPARSE_VDL 0x10000000 +#endif +#ifndef FILE_DAX_VOLUME +#define FILE_DAX_VOLUME 0x20000000 +#endif +#ifndef FILE_SUPPORTS_GHOSTING +#define FILE_SUPPORTS_GHOSTING 0x40000000 +#endif + /* So-called "Microsoft Account" SIDs (S-1-11-...) have a netbios domain name "MicrosoftAccounts". The new "Application Container SIDs" (S-1-15-...) have a netbios domain name "APPLICATION PACKAGE AUTHORITY" diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index b44d60e1e3eb..627d120059a3 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -319,12 +319,49 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) to Windows 11. The important point here is to test only flags indicating capabilities and to ignore flags indicating a specific state of this volume. At present these flags to ignore are FILE_VOLUME_IS_COMPRESSED, - FILE_READ_ONLY_VOLUME, and FILE_SEQUENTIAL_WRITE_ONCE. The additional - filesystem flags supported since Windows 7 are also ignored for now. - They add information only for filesystems also supporting these flags, - right now only NTFS. */ -#define GETVOLINFO_VALID_MASK (0x002701ffUL) + FILE_READ_ONLY_VOLUME, FILE_SEQUENTIAL_WRITE_ONCE and FILE_DAX_VOLUME. */ +#define GETVOLINFO_VALID_MASK (FILE_CASE_SENSITIVE_SEARCH \ + | FILE_CASE_PRESERVED_NAMES \ + | FILE_UNICODE_ON_DISK \ + | FILE_PERSISTENT_ACLS \ + | FILE_FILE_COMPRESSION \ + | FILE_VOLUME_QUOTAS \ + | FILE_SUPPORTS_SPARSE_FILES \ + | FILE_SUPPORTS_REPARSE_POINTS \ + | FILE_SUPPORTS_REMOTE_STORAGE \ + | FILE_RETURNS_CLEANUP_RESULT_INFO \ + | FILE_SUPPORTS_POSIX_UNLINK_RENAME \ + | FILE_SUPPORTS_OBJECT_IDS \ + | FILE_SUPPORTS_ENCRYPTION \ + | FILE_NAMED_STREAMS \ + | FILE_SUPPORTS_TRANSACTIONS \ + | FILE_SUPPORTS_HARD_LINKS \ + | FILE_SUPPORTS_EXTENDED_ATTRIBUTES \ + | FILE_SUPPORTS_OPEN_BY_FILE_ID \ + | FILE_SUPPORTS_USN_JOURNAL \ + | FILE_SUPPORTS_INTEGRITY_STREAMS \ + | FILE_SUPPORTS_BLOCK_REFCOUNTING \ + | FILE_SUPPORTS_SPARSE_VDL \ + | FILE_SUPPORTS_GHOSTING) +/* This is the pre-Win7 mask used to recognize 3rd-party drivers. We'll never + learn in time when those drivers start to support the new (har har) Win7 FS + flags. */ +#define GETVOLINFO_NON_WIN_MASK (FILE_CASE_SENSITIVE_SEARCH \ + | FILE_CASE_PRESERVED_NAMES \ + | FILE_UNICODE_ON_DISK \ + | FILE_PERSISTENT_ACLS \ + | FILE_FILE_COMPRESSION \ + | FILE_VOLUME_QUOTAS \ + | FILE_SUPPORTS_SPARSE_FILES \ + | FILE_SUPPORTS_REPARSE_POINTS \ + | FILE_SUPPORTS_REMOTE_STORAGE \ + | FILE_SUPPORTS_OBJECT_IDS \ + | FILE_SUPPORTS_ENCRYPTION \ + | FILE_NAMED_STREAMS \ + | FILE_SUPPORTS_TRANSACTIONS) + #define TEST_GVI(f,m) (((f) & GETVOLINFO_VALID_MASK) == (m)) +#define TEST_GVI_NON_WIN(f,m) (((f) & GETVOLINFO_NON_WIN_MASK) == (m)) /* FIXME: This flag twist is getting awkward. There should really be some other method. Maybe we need mount flags to allow the user to fix file @@ -335,7 +372,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) #define SAMBA_IGNORE (FILE_VOLUME_QUOTAS \ | FILE_SUPPORTS_OBJECT_IDS \ | FILE_UNICODE_ON_DISK) -#define FS_IS_SAMBA TEST_GVI(flags () & ~SAMBA_IGNORE, \ +#define FS_IS_SAMBA TEST_GVI_NON_WIN(flags () & ~SAMBA_IGNORE, \ FILE_CASE_SENSITIVE_SEARCH \ | FILE_CASE_PRESERVED_NAMES \ | FILE_PERSISTENT_ACLS) @@ -343,12 +380,12 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) #define NETAPP_IGNORE (FILE_SUPPORTS_SPARSE_FILES \ | FILE_SUPPORTS_REPARSE_POINTS \ | FILE_PERSISTENT_ACLS) -#define FS_IS_NETAPP_DATAONTAP TEST_GVI(flags () & ~NETAPP_IGNORE, \ +#define FS_IS_NETAPP_DATAONTAP TEST_GVI_NON_WIN(flags () & ~NETAPP_IGNORE, \ FILE_CASE_SENSITIVE_SEARCH \ | FILE_CASE_PRESERVED_NAMES \ | FILE_UNICODE_ON_DISK \ | FILE_NAMED_STREAMS) -/* These are the minimal flags supported by NTFS since Windows 2000. Every +/* These are the minimal flags supported by NTFS since Windows 7. Every filesystem not supporting these flags is not a native NTFS. We subsume them under the filesystem type "cifs". */ #define MINIMAL_WIN_NTFS_FLAGS (FILE_CASE_SENSITIVE_SEARCH \ @@ -361,7 +398,12 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) | FILE_SUPPORTS_REPARSE_POINTS \ | FILE_SUPPORTS_OBJECT_IDS \ | FILE_SUPPORTS_ENCRYPTION \ - | FILE_NAMED_STREAMS) + | FILE_NAMED_STREAMS \ + | FILE_SUPPORTS_TRANSACTIONS \ + | FILE_SUPPORTS_HARD_LINKS \ + | FILE_SUPPORTS_EXTENDED_ATTRIBUTES \ + | FILE_SUPPORTS_OPEN_BY_FILE_ID \ + | FILE_SUPPORTS_USN_JOURNAL) #define FS_IS_WINDOWS_NTFS TEST_GVI(flags () & MINIMAL_WIN_NTFS_FLAGS, \ MINIMAL_WIN_NTFS_FLAGS) /* These are the exact flags of a real Windows FAT/FAT32 filesystem.
reply other threads:[~2023-03-20 11:58 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230320115829.8936A3858C74@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).