]> sourceware.org Git - newlib-cygwin.git/commitdiff
* path.cc (fs_info::update): Define GETVOLINFO_VALID_MASK and TEST_GVI.
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 23 Nov 2006 11:28:52 +0000 (11:28 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 23 Nov 2006 11:28:52 +0000 (11:28 +0000)
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
winsup/cygwin/path.cc
winsup/cygwin/path.h

index 1b09730381d70b4f77b01ecc0be05c070dd54514..370464e89000ef3cc43e688aa5fc0f2526e3f5b4 100644 (file)
@@ -1,3 +1,12 @@
+2006-11-23  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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  <towo@computer.org>
 
        * fhandler_console.cc (set_color): Avoid (again) inappropriate
index 43ca6eeea0ab34f81c0052546161d491b8e73839..fbd15e667fb6b9eab8b36ded47b25b6d6f2ddd62 100644 (file)
@@ -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). */
index f50d27d4a206cedf8abbf0852e510b1a7e97f21f..4097053c772dd596b1a4c24333cac45e9e6605b5 100644 (file)
@@ -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 *);
 };
This page took 0.038759 seconds and 5 git commands to generate.