From 2d355410b7b59710e61b45e529900f9ebbd668e8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 30 Sep 2010 13:52:34 +0000 Subject: * fhandler.cc: Drop including nfs.h. * fhandler_disk_file.cc: Ditto. (fhandler_base::fstat_by_nfs_ea): Use fattr3 from path_conv member, unless called from fstat. * path.cc: Drop including nfs.h. (symlink_info::check): Rearrange definition of file info buffers. Fetch fattr3 info for files on NFS and store in conv_hdl for later use in fhandler_base::fstat_by_nfs_ea. Use fattr3 file type to recognize symlink on NFS and try to fetch symlink target only for actual symlinks. * path.h: Include nfs.h. (class path_conv_handle): Change file info storage to union of FILE_NETWORK_OPEN_INFORMATION and fattr3 structures. (path_conv_handle::fnoi): Align to aforementioned change. (path_conv_handle::nfsattr): New method. (path_conv::nfsattr): New method. --- winsup/cygwin/path.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'winsup/cygwin/path.h') diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index fae721664..764381a4a 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -12,6 +12,7 @@ details. */ #include "devices.h" #include "mount.h" #include "cygheap_malloc.h" +#include "nfs.h" #include #include @@ -96,17 +97,21 @@ class path_conv_handle { HANDLE hdl; ACCESS_MASK acc; - /* Identical to FILE_NETWORK_OPEN_INFORMATION. We don't want to pull in - ntdll.h here, though. */ - struct { - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG FileAttributes; - } _fnoi; + union { + /* Identical to FILE_NETWORK_OPEN_INFORMATION. We don't want to pull in + ntdll.h here, though. */ + struct { + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER AllocationSize; + LARGE_INTEGER EndOfFile; + ULONG FileAttributes; + } _fnoi; + /* For NFS. */ + fattr3 _fattr3; + } attribs; public: path_conv_handle () : hdl (NULL), acc (0) {} inline void set (HANDLE h, ACCESS_MASK a) { hdl = h; acc = a; } @@ -129,7 +134,9 @@ public: inline HANDLE handle () const { return hdl; } inline ACCESS_MASK access () const { return acc; } inline struct _FILE_NETWORK_OPEN_INFORMATION *fnoi () - { return (struct _FILE_NETWORK_OPEN_INFORMATION *) &_fnoi; } + { return (struct _FILE_NETWORK_OPEN_INFORMATION *) &attribs._fnoi; } + inline struct fattr3 *nfsattr () + { return (struct fattr3 *) &attribs._fattr3; } }; class path_conv @@ -321,6 +328,7 @@ class path_conv HANDLE handle () const { return conv_handle.handle (); } ACCESS_MASK access () const { return conv_handle.access (); } struct _FILE_NETWORK_OPEN_INFORMATION *fnoi () { return conv_handle.fnoi (); } + struct fattr3 *nfsattr () { return conv_handle.nfsattr (); } void reset_conv_handle () { conv_handle.set (NULL, 0); } void close_conv_handle () { conv_handle.close (); } -- cgit v1.2.3