From 86404692c60b3fb04f1450dcee7837ee6940a414 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 23 Nov 2006 11:28:52 +0000 Subject: [PATCH] * path.cc (fs_info::update): Define GETVOLINFO_VALID_MASK and TEST_GVI. Change FS_IS_SAMBA and FS_IS_SAMBA_WITH_QUOTA and their usage accordingly. Define FS_IS_NETAPP_DATAONTAP. Recognize NetApp device and store in is_netapp flag. Mark NetApp device as having no good inodes. * path.h (struct fs_info): Add is_netapp flag. Add matching accessors. --- winsup/cygwin/ChangeLog | 9 +++++++++ winsup/cygwin/path.cc | 40 +++++++++++++++++++++++++++++----------- winsup/cygwin/path.h | 3 +++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1b0973038..370464e89 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2006-11-23 Corinna Vinschen + + * path.cc (fs_info::update): Define GETVOLINFO_VALID_MASK and TEST_GVI. + Change FS_IS_SAMBA and FS_IS_SAMBA_WITH_QUOTA and their usage + accordingly. Define FS_IS_NETAPP_DATAONTAP. Recognize NetApp device + and store in is_netapp flag. Mark NetApp device as having no good + inodes. + * path.h (struct fs_info): Add is_netapp flag. Add matching accessors. + 2006-11-23 Thomas Wolff * fhandler_console.cc (set_color): Avoid (again) inappropriate diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 43ca6eeea..fbd15e667 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -426,25 +426,43 @@ fs_info::update (const char *win32_path) return false; } -#define FS_IS_SAMBA (FILE_CASE_SENSITIVE_SEARCH \ - | FILE_CASE_PRESERVED_NAMES \ - | FILE_PERSISTENT_ACLS) -#define FS_IS_SAMBA_WITH_QUOTA \ - (FILE_CASE_SENSITIVE_SEARCH \ - | FILE_CASE_PRESERVED_NAMES \ - | FILE_PERSISTENT_ACLS \ - | FILE_VOLUME_QUOTAS) +/* Should be reevaluated for each new OS. Right now this mask is valid up + to Vista. 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 + and FILE_READ_ONLY_VOLUME. */ +#define GETVOLINFO_VALID_MASK (0x003701ffUL) +#define TEST_GVI(f,m) (((f) & GETVOLINFO_VALID_MASK) == (m)) + +#define FS_IS_SAMBA TEST_GVI(flags (), \ + FILE_CASE_SENSITIVE_SEARCH \ + | FILE_CASE_PRESERVED_NAMES \ + | FILE_PERSISTENT_ACLS) +#define FS_IS_SAMBA_WITH_QUOTA TEST_GVI(flags (), \ + FILE_CASE_SENSITIVE_SEARCH \ + | FILE_CASE_PRESERVED_NAMES \ + | FILE_PERSISTENT_ACLS \ + | FILE_VOLUME_QUOTAS) +#define FS_IS_NETAPP_DATAONTAP TEST_GVI(flags (), \ + FILE_CASE_SENSITIVE_SEARCH \ + | FILE_CASE_PRESERVED_NAMES \ + | FILE_UNICODE_ON_DISK \ + | FILE_PERSISTENT_ACLS \ + | FILE_NAMED_STREAMS) is_fat (strncasematch (fsname, "FAT", 3)); is_samba (strcmp (fsname, "NTFS") == 0 && is_remote_drive () - && (flags () == FS_IS_SAMBA || flags () == FS_IS_SAMBA_WITH_QUOTA)); - is_ntfs (strcmp (fsname, "NTFS") == 0 && !is_samba ()); + && (FS_IS_SAMBA || FS_IS_SAMBA_WITH_QUOTA)); + is_netapp (strcmp (fsname, "NTFS") == 0 && is_remote_drive () + && FS_IS_NETAPP_DATAONTAP); + is_ntfs (strcmp (fsname, "NTFS") == 0 && !is_samba () && !is_netapp ()); is_nfs (strcmp (fsname, "NFS") == 0); has_ea (is_ntfs ()); has_acls ((flags () & FS_PERSISTENT_ACLS) && (allow_smbntsec || !is_remote_drive ())); hasgood_inode (((flags () & FILE_PERSISTENT_ACLS) - && drive_type () != DRIVE_UNKNOWN) + && drive_type () != DRIVE_UNKNOWN + && !is_netapp ()) || is_nfs ()); /* Known file systems with buggy open calls. Further explanation in fhandler.cc (fhandler_disk_file::open). */ diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index f50d27d4a..4097053c7 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -100,6 +100,7 @@ struct fs_info unsigned is_ntfs : 1; unsigned is_samba : 1; unsigned is_nfs : 1; + unsigned is_netapp : 1; } status; public: void clear () @@ -116,6 +117,7 @@ struct fs_info is_ntfs (false); is_samba (false); is_nfs (false); + is_netapp (false); } inline DWORD& flags () {return status.flags;}; inline DWORD& serial () {return status.serial;}; @@ -130,6 +132,7 @@ struct fs_info IMPLEMENT_STATUS_FLAG (bool, is_ntfs) IMPLEMENT_STATUS_FLAG (bool, is_samba) IMPLEMENT_STATUS_FLAG (bool, is_nfs) + IMPLEMENT_STATUS_FLAG (bool, is_netapp) bool update (const char *); }; -- 2.43.5