]> sourceware.org Git - newlib-cygwin.git/commitdiff
Drop unused path_conv::ndisk_links method
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 9 Dec 2015 22:56:47 +0000 (23:56 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 9 Dec 2015 22:56:47 +0000 (23:56 +0100)
        * fhandler_disk_file.cc (path_conv::ndisk_links): Drop unused method.
        (fhandler_base::fstat_helper): Drop unused call to ndisk_links.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/path.h

index f564f7987cd40e02563cf0c4a8ff07ced2ff6b8f..079aa89f804c1a3ee463805a3a772192010bf27e 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-10  Corinna Vinschen  <corinna@vinschen.de>
+
+       * fhandler_disk_file.cc (path_conv::ndisk_links): Drop unused method.
+       (fhandler_base::fstat_helper): Drop unused call to ndisk_links.
+
 2015-12-10  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Rename fai to
index 76060005ced2f9072dc796fc80c5f44d1e920e35..e7e22a2403fe752b21707948ee759c00bb93f356 100644 (file)
@@ -233,88 +233,6 @@ path_conv::get_ino_by_handle (HANDLE hdl)
   return 0;
 }
 
-#if 0
-/* This function is obsolete.  We're keeping it in so we don't forget
-   that we already did all that at one point. */
-unsigned __stdcall
-path_conv::ndisk_links (DWORD nNumberOfLinks)
-{
-  if (!isdir () || isremote ())
-    return nNumberOfLinks;
-
-  OBJECT_ATTRIBUTES attr;
-  IO_STATUS_BLOCK io;
-  HANDLE fh;
-
-  if (!NT_SUCCESS (NtOpenFile (&fh, SYNCHRONIZE | FILE_LIST_DIRECTORY,
-                              get_object_attr (attr, sec_none_nih),
-                              &io, FILE_SHARE_VALID_FLAGS,
-                              FILE_SYNCHRONOUS_IO_NONALERT
-                              | FILE_OPEN_FOR_BACKUP_INTENT
-                              | FILE_DIRECTORY_FILE)))
-    return nNumberOfLinks;
-
-  unsigned count = 0;
-  bool first = true;
-  PFILE_BOTH_DIR_INFORMATION fdibuf = (PFILE_BOTH_DIR_INFORMATION)
-                                      alloca (65536);
-  __DIR_mounts *dir = new __DIR_mounts (get_posix ());
-  while (NT_SUCCESS (NtQueryDirectoryFile (fh, NULL, NULL, NULL, &io, fdibuf,
-                                          65536, FileBothDirectoryInformation,
-                                          FALSE, NULL, first)))
-    {
-      if (first)
-       {
-         first = false;
-         /* All directories have . and .. as their first entries.
-            If . is not present as first entry, we're on a drive's
-            root direcotry, which doesn't have these entries. */
-         if (fdibuf->FileNameLength != 2 || fdibuf->FileName[0] != L'.')
-           count = 2;
-       }
-      for (PFILE_BOTH_DIR_INFORMATION pfdi = fdibuf;
-          pfdi;
-          pfdi = (PFILE_BOTH_DIR_INFORMATION)
-                 (pfdi->NextEntryOffset ? (PBYTE) pfdi + pfdi->NextEntryOffset
-                                        : NULL))
-       {
-         switch (pfdi->FileAttributes
-                 & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))
-           {
-           case FILE_ATTRIBUTE_DIRECTORY:
-             /* Just a directory */
-             ++count;
-             break;
-           case FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT:
-             /* Volume mount point or symlink to directory */
-             {
-               UNICODE_STRING fname;
-
-               RtlInitCountedUnicodeString (&fname, pfdi->FileName,
-                                            pfdi->FileNameLength);
-               InitializeObjectAttributes (&attr, &fname,
-                                           objcaseinsensitive (), fh, NULL);
-               if (is_volume_mountpoint (&attr))
-                 ++count;
-             }
-             break;
-           default:
-             break;
-           }
-         UNICODE_STRING fname;
-         RtlInitCountedUnicodeString (&fname, pfdi->FileName,
-                                      pfdi->FileNameLength);
-         dir->check_mount (&fname, 0, false);
-       }
-    }
-  while (dir->check_missing_mount ())
-    ++count;
-  NtClose (fh);
-  delete dir;
-  return count;
-}
-#endif
-
 /* For files on NFS shares, we request an EA of type NfsV3Attributes.
    This returns the content of a struct fattr3 as defined in RFC 1813.
    The content is the NFS equivalent of struct stat. so there's not much
@@ -573,11 +491,7 @@ fhandler_base::fstat_helper (struct stat *buf, DWORD nNumberOfLinks)
   /* The number of links to a directory includes the number of subdirectories
      in the directory, since all those subdirectories point to it.  However,
      this is painfully slow, so we do without it. */
-#if 0
-  buf->st_nlink = pc.ndisk_links (nNumberOfLinks);
-#else
   buf->st_nlink = nNumberOfLinks;
-#endif
 
   /* Enforce namehash as inode number on untrusted file systems. */
   if (ino && pc.isgood_inode (ino))
index ce41645e0073b3d7c1f9250c7aa1c69eda157f0b..ab7222ee054b8debe64c250a906477a653758b72 100644 (file)
@@ -396,9 +396,6 @@ class path_conv
   void close_conv_handle () { conv_handle.close (); }
 
   ino_t get_ino_by_handle (HANDLE h);
-#if 0 /* obsolete, method still exists in fhandler_disk_file.cc */
-  unsigned __stdcall ndisk_links (DWORD);
-#endif
   inline const char *get_posix () const { return posix_path; }
   void __reg2 set_posix (const char *);
   DWORD get_symlink_length () { return symlink_length; };
This page took 0.040049 seconds and 5 git commands to generate.