diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-05-20 15:11:23 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-05-20 15:11:23 +0000 |
commit | fe6934da140da55db628d5f940e4bddbfd06a960 (patch) | |
tree | 5b69355ddcd6e6469f1f7b0be1022105d3be677c /winsup/cygwin/nfs.h | |
parent | 2f33b79950a24de3307e62aaa678ade9a9c11089 (diff) | |
download | cygnal-fe6934da140da55db628d5f940e4bddbfd06a960.tar.gz cygnal-fe6934da140da55db628d5f940e4bddbfd06a960.tar.bz2 cygnal-fe6934da140da55db628d5f940e4bddbfd06a960.zip |
* Makefile.in (DLL_OFILES): Add nfs.o.
* fhandler.cc (fhandler_base::open): Open files on NFS shares with
correct access flags and EAs.
* fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare.
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method.
(fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on
NFS shares.
(fhandler_disk_file::fchmod): Use NFS specific method to set mode for
files on NFS shares. Don't overrule errno from call to
set_file_attribute with errno from NtSetInformationFile call.
(fhandler_disk_file::fchown): Add comment.
* mount.cc (fillout_mntent): Accommodate change in second parameter
to fs_info::update.
* nfs.cc: New file.
* nfs.h: New file.
* path.cc (fs_info::update): Take handle instead of bool as second
parameter. Use that handle if it's not NULL. Only close handle if
it has been opened here. Use static defined buffers instead of
alloca'd buffers.
(path_conv::check): Call symlink_info::check with reference to fs.
Don't call fs.update here if file exists.
(conv_path_list): Prefer tmp_pathbuf buffer over using alloca.
(symlink_worker): Use NFS specific method to create symlinks on NFS
shares. Prefer tmp_pathbuf buffer over using alloca.
(symlink_info::check_shortcut): Reopen file from incoming handle
with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over
using alloca.
(symlink_info::check_sysfile): Ditto.
(symlink_info::check_reparse_point): Use tmp_pathbuf buffer to
allocate REPARSE_DATA_BUFFER.
(symlink_info::check_nfs_symlink): New method.
(enum symlink_t): Remove.
(symlink_info::check): Don't use NtQueryAttributesFile. Rather, open
file with necessary access flags and call NtQueryInformationFile. Fix
error handling in case file can't be opened. For existing files, call
fs_info::update here. Restructure symlink checking to accommodate the
fact that the file is already open. Add case for NFS symlinks.
* path.h (fs_info::update): Take handle instead of bool as second
parameter.
Diffstat (limited to 'winsup/cygwin/nfs.h')
-rw-r--r-- | winsup/cygwin/nfs.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/winsup/cygwin/nfs.h b/winsup/cygwin/nfs.h new file mode 100644 index 000000000..657126f78 --- /dev/null +++ b/winsup/cygwin/nfs.h @@ -0,0 +1,55 @@ +/* nfs.h + + Copyright 2008 Red Hat, Inc. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#define NFS_ACT_ON_LINK "NfsActOnLink" +#define NFS_SYML_TARGET "NfsSymlinkTargetName" +#define NFS_V3_ATTR "NfsV3Attributes" + +/* NFS datastructures per RFC 1813, as returned by SFU NFS. */ + +enum ftype3 { + NF3REG = 1, + NF3DIR = 2, + NF3BLK = 3, + NF3CHR = 4, + NF3LNK = 5, + NF3SOCK = 6, + NF3FIFO = 7 +}; + +struct fattr3 { + uint32_t type; + uint32_t mode; + uint32_t nlink; + uint32_t uid; + uint32_t gid; + uint32_t filler1; + uint64_t size; + uint64_t used; + struct + { + uint32_t specdata1; + uint32_t specdata2; + } rdev; + uint64_t fsid; + uint64_t fileid; + timestruc_t atime; + timestruc_t mtime; + timestruc_t ctime; +}; + +struct nfs_aol_ffei_t { + ULONG NextEntryOffset; + UCHAR Flags; + UCHAR EaNameLength; + USHORT EaValueLength; + CHAR EaName[sizeof (NFS_ACT_ON_LINK)]; +}; +extern struct nfs_aol_ffei_t nfs_aol_ffei; + +extern uint32_t nfs_type_mapping[]; |