summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/mount.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-07-16 09:56:25 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-07-16 09:56:25 +0000
commitfc261e53f0d8a5743d7b2f8de9608cefecf36edb (patch)
tree39b3ac7c968e6aecb669effe80b4e76d5bd4a2c5 /winsup/cygwin/mount.h
parent5e5a84371166bdee1cd35c6692b09b989e62ce61 (diff)
downloadcygnal-fc261e53f0d8a5743d7b2f8de9608cefecf36edb.tar.gz
cygnal-fc261e53f0d8a5743d7b2f8de9608cefecf36edb.tar.bz2
cygnal-fc261e53f0d8a5743d7b2f8de9608cefecf36edb.zip
* globals.cc: Reorder constant UNICODE_STRINGs for clarity.
* mount.h (fs_info::sttaus): Move filesystem type flags into substructure. Add union to allow simple test for having set any one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag. (fs_info::got_fs): New private method. (fs_info::has_buggy_open): New explicit implementation. (fs_info::has_buggy_fileid_dirinfo): Ditto. * mount.cc (fs_info::update): Optimize filesystem checks for speed. * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return value just set.
Diffstat (limited to 'winsup/cygwin/mount.h')
-rw-r--r--winsup/cygwin/mount.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/winsup/cygwin/mount.h b/winsup/cygwin/mount.h
index 9836636c7..bc6de12b0 100644
--- a/winsup/cygwin/mount.h
+++ b/winsup/cygwin/mount.h
@@ -20,21 +20,30 @@ class fs_info
ULONG samba_version; /* Samba version if available */
ULONG name_len; /* MaximumComponentNameLength */
unsigned is_remote_drive : 1;
- unsigned has_buggy_open : 1;
- unsigned has_buggy_fileid_dirinfo : 1;
unsigned has_acls : 1;
unsigned hasgood_inode : 1;
unsigned caseinsensitive : 1;
- unsigned is_fat : 1;
- unsigned is_ntfs : 1;
- unsigned is_samba : 1;
- unsigned is_nfs : 1;
- unsigned is_netapp : 1;
- unsigned is_cdrom : 1;
- unsigned is_udf : 1;
- unsigned is_csc_cache : 1;
+ union
+ {
+ struct
+ {
+ unsigned is_fat : 1;
+ unsigned is_ntfs : 1;
+ unsigned is_samba : 1;
+ unsigned is_nfs : 1;
+ unsigned is_netapp : 1;
+ unsigned is_cdrom : 1;
+ unsigned is_udf : 1;
+ unsigned is_csc_cache : 1;
+ unsigned is_sunwnfs : 1;
+ unsigned is_unixfs : 1;
+ };
+ unsigned long fs_flags;
+ };
} status;
ULONG sernum;
+ unsigned long got_fs () { return status.fs_flags; }
+
public:
void clear () { memset (&status, 0 , sizeof status); sernum = 0UL; }
fs_info () { clear (); }
@@ -43,8 +52,6 @@ class fs_info
IMPLEMENT_STATUS_FLAG (ULONG, samba_version)
IMPLEMENT_STATUS_FLAG (ULONG, name_len)
IMPLEMENT_STATUS_FLAG (bool, is_remote_drive)
- IMPLEMENT_STATUS_FLAG (bool, has_buggy_open)
- IMPLEMENT_STATUS_FLAG (bool, has_buggy_fileid_dirinfo)
IMPLEMENT_STATUS_FLAG (bool, has_acls)
IMPLEMENT_STATUS_FLAG (bool, hasgood_inode)
IMPLEMENT_STATUS_FLAG (bool, caseinsensitive)
@@ -56,8 +63,13 @@ class fs_info
IMPLEMENT_STATUS_FLAG (bool, is_cdrom)
IMPLEMENT_STATUS_FLAG (bool, is_udf)
IMPLEMENT_STATUS_FLAG (bool, is_csc_cache)
+ IMPLEMENT_STATUS_FLAG (bool, is_sunwnfs)
+ IMPLEMENT_STATUS_FLAG (bool, is_unixfs)
ULONG serial_number () const { return sernum; }
+ int has_buggy_open () const {return is_sunwnfs ();}
+ int has_buggy_fileid_dirinfo () const {return is_unixfs ();}
+
bool update (PUNICODE_STRING, HANDLE) __attribute__ ((regparm (3)));
};