* 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>
* fhandler_console.cc (set_color): Avoid (again) inappropriate

View 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). */

View 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 *);
};