* 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.
This commit is contained in:
Corinna Vinschen 2006-11-23 11:28:52 +00:00
parent bf4071fad0
commit 86404692c6
3 changed files with 41 additions and 11 deletions

View 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> 2006-11-23 Thomas Wolff <towo@computer.org>
* fhandler_console.cc (set_color): Avoid (again) inappropriate * fhandler_console.cc (set_color): Avoid (again) inappropriate

View File

@ -426,25 +426,43 @@ fs_info::update (const char *win32_path)
return false; return false;
} }
#define FS_IS_SAMBA (FILE_CASE_SENSITIVE_SEARCH \ /* Should be reevaluated for each new OS. Right now this mask is valid up
| FILE_CASE_PRESERVED_NAMES \ to Vista. The important point here is to test only flags indicating
| FILE_PERSISTENT_ACLS) capabilities and to ignore flags indicating a specific state of this
#define FS_IS_SAMBA_WITH_QUOTA \ volume. At present these flags to ignore are FILE_VOLUME_IS_COMPRESSED
(FILE_CASE_SENSITIVE_SEARCH \ and FILE_READ_ONLY_VOLUME. */
| FILE_CASE_PRESERVED_NAMES \ #define GETVOLINFO_VALID_MASK (0x003701ffUL)
| FILE_PERSISTENT_ACLS \ #define TEST_GVI(f,m) (((f) & GETVOLINFO_VALID_MASK) == (m))
| FILE_VOLUME_QUOTAS)
#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_fat (strncasematch (fsname, "FAT", 3));
is_samba (strcmp (fsname, "NTFS") == 0 && is_remote_drive () is_samba (strcmp (fsname, "NTFS") == 0 && is_remote_drive ()
&& (flags () == FS_IS_SAMBA || flags () == FS_IS_SAMBA_WITH_QUOTA)); && (FS_IS_SAMBA || FS_IS_SAMBA_WITH_QUOTA));
is_ntfs (strcmp (fsname, "NTFS") == 0 && !is_samba ()); 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); is_nfs (strcmp (fsname, "NFS") == 0);
has_ea (is_ntfs ()); has_ea (is_ntfs ());
has_acls ((flags () & FS_PERSISTENT_ACLS) has_acls ((flags () & FS_PERSISTENT_ACLS)
&& (allow_smbntsec || !is_remote_drive ())); && (allow_smbntsec || !is_remote_drive ()));
hasgood_inode (((flags () & FILE_PERSISTENT_ACLS) hasgood_inode (((flags () & FILE_PERSISTENT_ACLS)
&& drive_type () != DRIVE_UNKNOWN) && drive_type () != DRIVE_UNKNOWN
&& !is_netapp ())
|| is_nfs ()); || is_nfs ());
/* Known file systems with buggy open calls. Further explanation /* Known file systems with buggy open calls. Further explanation
in fhandler.cc (fhandler_disk_file::open). */ in fhandler.cc (fhandler_disk_file::open). */

View File

@ -100,6 +100,7 @@ struct fs_info
unsigned is_ntfs : 1; unsigned is_ntfs : 1;
unsigned is_samba : 1; unsigned is_samba : 1;
unsigned is_nfs : 1; unsigned is_nfs : 1;
unsigned is_netapp : 1;
} status; } status;
public: public:
void clear () void clear ()
@ -116,6 +117,7 @@ struct fs_info
is_ntfs (false); is_ntfs (false);
is_samba (false); is_samba (false);
is_nfs (false); is_nfs (false);
is_netapp (false);
} }
inline DWORD& flags () {return status.flags;}; inline DWORD& flags () {return status.flags;};
inline DWORD& serial () {return status.serial;}; inline DWORD& serial () {return status.serial;};
@ -130,6 +132,7 @@ struct fs_info
IMPLEMENT_STATUS_FLAG (bool, is_ntfs) IMPLEMENT_STATUS_FLAG (bool, is_ntfs)
IMPLEMENT_STATUS_FLAG (bool, is_samba) IMPLEMENT_STATUS_FLAG (bool, is_samba)
IMPLEMENT_STATUS_FLAG (bool, is_nfs) IMPLEMENT_STATUS_FLAG (bool, is_nfs)
IMPLEMENT_STATUS_FLAG (bool, is_netapp)
bool update (const char *); bool update (const char *);
}; };