public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Use new path_conv_handle functions to access file info Date: Tue, 21 Jun 2016 11:39:00 -0000 [thread overview] Message-ID: <20160621113953.25964.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=36d4eb12b5f23093ae1285d0725f4930235a07e5 commit 36d4eb12b5f23093ae1285d0725f4930235a07e5 Author: Corinna Vinschen <corinna@vinschen.de> Date: Tue Jun 21 13:28:12 2016 +0200 Use new path_conv_handle functions to access file info This avoids having to call nfs_fetch_fattr3/file_get_fai depending on FS type as well as having to extract the info FS dependent. Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- winsup/cygwin/fhandler_disk_file.cc | 4 ++-- winsup/cygwin/path.cc | 16 +++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 2cf738f..3da5191 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -254,7 +254,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf) NFS client. */ if (get_access () & GENERIC_WRITE) FlushFileBuffers (get_io_handle ()); - nfs_fetch_fattr3 (get_io_handle (), nfs_attr); + pc.get_finfo (get_io_handle ()); } buf->st_dev = nfs_attr->fsid; buf->st_ino = nfs_attr->fileid; @@ -326,7 +326,7 @@ fhandler_base::fstat_by_handle (struct stat *buf) on the information stored in pc.fai. So we overwrite them here. */ if (get_io_handle ()) { - status = file_get_fai (h, pc.fai ()); + status = pc.get_finfo (h); if (!NT_SUCCESS (status)) { debug_printf ("%y = NtQueryInformationFile(%S, FileAllInformation)", diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 18d5c1d..72b152c 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2794,19 +2794,9 @@ restart: This speeds up path_conv noticably (~10%). */ && (fs.inited () || fs.update (&upath, h))) { - if (fs.is_nfs ()) - { - status = nfs_fetch_fattr3 (h, conv_hdl.nfsattr ()); - if (NT_SUCCESS (status)) - fileattr = ((conv_hdl.nfsattr ()->type & 7) == NF3DIR) - ? FILE_ATTRIBUTE_DIRECTORY : 0; - } - else - { - status = file_get_fai (h, conv_hdl.fai ()); - if (NT_SUCCESS (status)) - fileattr = conv_hdl.fai ()->BasicInformation.FileAttributes; - } + status = conv_hdl.get_finfo (h, fs.is_nfs ()); + if (NT_SUCCESS (status)) + fileattr = conv_hdl.get_dosattr (fs.is_nfs ()); } if (!NT_SUCCESS (status)) {
reply other threads:[~2016-06-21 11:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20160621113953.25964.qmail@sourceware.org \ --to=corinna@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).