* fhandler_disk_file.cc (path_conv::get_ino_by_handle): Convert from
static function to path_conv method. Accommodate throughout. (path_conv::ndisk_links): Unused, comment out. * path.h (path_conv::get_ino_by_handle): Declare. (path_conv::ndisk_links): Comment out declaration.
This commit is contained in:
parent
d955b6cfd8
commit
5e3dd23eee
|
@ -1,3 +1,11 @@
|
||||||
|
2010-06-15 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_disk_file.cc (path_conv::get_ino_by_handle): Convert from
|
||||||
|
static function to path_conv method. Accommodate throughout.
|
||||||
|
(path_conv::ndisk_links): Unused, comment out.
|
||||||
|
* path.h (path_conv::get_ino_by_handle): Declare.
|
||||||
|
(path_conv::ndisk_links): Comment out declaration.
|
||||||
|
|
||||||
2010-06-14 Corinna Vinschen <corinna@vinschen.de>
|
2010-06-14 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (path_conv::check): Return with ENOTDIR if component is a
|
* path.cc (path_conv::check): Return with ENOTDIR if component is a
|
||||||
|
|
|
@ -178,19 +178,22 @@ is_volume_mountpoint (POBJECT_ATTRIBUTES attr)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline __ino64_t
|
inline __ino64_t
|
||||||
get_ino_by_handle (path_conv &pc, HANDLE hdl)
|
path_conv::get_ino_by_handle (HANDLE hdl)
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK io;
|
IO_STATUS_BLOCK io;
|
||||||
FILE_INTERNAL_INFORMATION fai;
|
FILE_INTERNAL_INFORMATION fai;
|
||||||
|
|
||||||
if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fai, sizeof fai,
|
if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fai, sizeof fai,
|
||||||
FileInternalInformation))
|
FileInternalInformation))
|
||||||
&& pc.isgood_inode (fai.FileId.QuadPart))
|
&& isgood_inode (fai.FileId.QuadPart))
|
||||||
return fai.FileId.QuadPart;
|
return fai.FileId.QuadPart;
|
||||||
return 0;
|
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
|
unsigned __stdcall
|
||||||
path_conv::ndisk_links (DWORD nNumberOfLinks)
|
path_conv::ndisk_links (DWORD nNumberOfLinks)
|
||||||
{
|
{
|
||||||
|
@ -268,6 +271,7 @@ path_conv::ndisk_links (DWORD nNumberOfLinks)
|
||||||
delete dir;
|
delete dir;
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For files on NFS shares, we request an EA of type NfsV3Attributes.
|
/* 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.
|
This returns the content of a struct fattr3 as defined in RFC 1813.
|
||||||
|
@ -549,12 +553,9 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
|
||||||
to_timestruc_t ((PFILETIME) CreationTime, &buf->st_birthtim);
|
to_timestruc_t ((PFILETIME) CreationTime, &buf->st_birthtim);
|
||||||
buf->st_rdev = buf->st_dev = dwVolumeSerialNumber;
|
buf->st_rdev = buf->st_dev = dwVolumeSerialNumber;
|
||||||
buf->st_size = (_off64_t) nFileSize;
|
buf->st_size = (_off64_t) nFileSize;
|
||||||
/* The number of links to a directory includes the
|
/* The number of links to a directory includes the number of subdirectories
|
||||||
number of subdirectories in the directory, since all
|
in the directory, since all those subdirectories point to it. However,
|
||||||
those subdirectories point to it.
|
this is painfully slow, so we do without it. */
|
||||||
This is too slow on remote drives, so we do without it.
|
|
||||||
Setting the count to 2 confuses `find (1)' command. So
|
|
||||||
let's try it with `1' as link count. */
|
|
||||||
#if 0
|
#if 0
|
||||||
buf->st_nlink = pc.ndisk_links (nNumberOfLinks);
|
buf->st_nlink = pc.ndisk_links (nNumberOfLinks);
|
||||||
#else
|
#else
|
||||||
|
@ -1450,7 +1451,7 @@ fhandler_base::open_fs (int flags, mode_t mode)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ino = get_ino_by_handle (pc, get_handle ());
|
ino = pc.get_ino_by_handle (get_handle ());
|
||||||
/* A unique ID is necessary to recognize fhandler entries which are
|
/* A unique ID is necessary to recognize fhandler entries which are
|
||||||
duplicated by dup(2) or fork(2). */
|
duplicated by dup(2) or fork(2). */
|
||||||
AllocateLocallyUniqueId ((PLUID) &unique_id);
|
AllocateLocallyUniqueId ((PLUID) &unique_id);
|
||||||
|
@ -1791,7 +1792,7 @@ readdir_get_ino (const char *path, bool dot_dot)
|
||||||
| (pc.is_rep_symlink ()
|
| (pc.is_rep_symlink ()
|
||||||
? FILE_OPEN_REPARSE_POINT : 0))))
|
? FILE_OPEN_REPARSE_POINT : 0))))
|
||||||
{
|
{
|
||||||
ino = get_ino_by_handle (pc, hdl);
|
ino = pc.get_ino_by_handle (hdl);
|
||||||
if (!ino)
|
if (!ino)
|
||||||
ino = hash_path_name (0, pc.get_nt_native_path ());
|
ino = hash_path_name (0, pc.get_nt_native_path ());
|
||||||
NtClose (hdl);
|
NtClose (hdl);
|
||||||
|
@ -1848,7 +1849,7 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err,
|
||||||
FILE_SHARE_VALID_FLAGS,
|
FILE_SHARE_VALID_FLAGS,
|
||||||
FILE_OPEN_FOR_BACKUP_INTENT))))
|
FILE_OPEN_FOR_BACKUP_INTENT))))
|
||||||
{
|
{
|
||||||
de->d_ino = get_ino_by_handle (pc, reph);
|
de->d_ino = pc.get_ino_by_handle (reph);
|
||||||
NtClose (reph);
|
NtClose (reph);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2040,14 +2041,14 @@ go_ahead:
|
||||||
filesystems it's no safe bet that "." and ".." entries always
|
filesystems it's no safe bet that "." and ".." entries always
|
||||||
come first. */
|
come first. */
|
||||||
if (FileNameLength == sizeof (WCHAR) && FileName[0] == '.')
|
if (FileNameLength == sizeof (WCHAR) && FileName[0] == '.')
|
||||||
de->d_ino = get_ino_by_handle (pc, get_handle ());
|
de->d_ino = pc.get_ino_by_handle (get_handle ());
|
||||||
else if (FileNameLength == 2 * sizeof (WCHAR)
|
else if (FileNameLength == 2 * sizeof (WCHAR)
|
||||||
&& FileName[0] == L'.' && FileName[1] == L'.')
|
&& FileName[0] == L'.' && FileName[1] == L'.')
|
||||||
{
|
{
|
||||||
if (!(dir->__flags & dirent_isroot))
|
if (!(dir->__flags & dirent_isroot))
|
||||||
de->d_ino = readdir_get_ino (get_name (), true);
|
de->d_ino = readdir_get_ino (get_name (), true);
|
||||||
else
|
else
|
||||||
de->d_ino = get_ino_by_handle (pc, get_handle ());
|
de->d_ino = pc.get_ino_by_handle (get_handle ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2082,7 +2083,7 @@ go_ahead:
|
||||||
| FILE_OPEN_REPARSE_POINT);
|
| FILE_OPEN_REPARSE_POINT);
|
||||||
if (NT_SUCCESS (f_status))
|
if (NT_SUCCESS (f_status))
|
||||||
{
|
{
|
||||||
de->d_ino = get_ino_by_handle (pc, hdl);
|
de->d_ino = pc.get_ino_by_handle (hdl);
|
||||||
NtClose (hdl);
|
NtClose (hdl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2098,7 +2099,7 @@ go_ahead:
|
||||||
else if (!(dir->__flags & dirent_saw_dot))
|
else if (!(dir->__flags & dirent_saw_dot))
|
||||||
{
|
{
|
||||||
strcpy (de->d_name , ".");
|
strcpy (de->d_name , ".");
|
||||||
de->d_ino = get_ino_by_handle (pc, get_handle ());
|
de->d_ino = pc.get_ino_by_handle (get_handle ());
|
||||||
dir->__d_position++;
|
dir->__d_position++;
|
||||||
dir->__flags |= dirent_saw_dot;
|
dir->__flags |= dirent_saw_dot;
|
||||||
res = 0;
|
res = 0;
|
||||||
|
@ -2109,7 +2110,7 @@ go_ahead:
|
||||||
if (!(dir->__flags & dirent_isroot))
|
if (!(dir->__flags & dirent_isroot))
|
||||||
de->d_ino = readdir_get_ino (get_name (), true);
|
de->d_ino = readdir_get_ino (get_name (), true);
|
||||||
else
|
else
|
||||||
de->d_ino = get_ino_by_handle (pc, get_handle ());
|
de->d_ino = pc.get_ino_by_handle (get_handle ());
|
||||||
dir->__d_position++;
|
dir->__d_position++;
|
||||||
dir->__flags |= dirent_saw_dot_dot;
|
dir->__flags |= dirent_saw_dot_dot;
|
||||||
res = 0;
|
res = 0;
|
||||||
|
|
|
@ -250,7 +250,10 @@ class path_conv
|
||||||
}
|
}
|
||||||
bool is_binary ();
|
bool is_binary ();
|
||||||
|
|
||||||
|
__ino64_t get_ino_by_handle (HANDLE h);
|
||||||
|
#if 0 /* obsolete, method still exists in fhandler_disk_file.cc */
|
||||||
unsigned __stdcall ndisk_links (DWORD);
|
unsigned __stdcall ndisk_links (DWORD);
|
||||||
|
#endif
|
||||||
void set_normalized_path (const char *) __attribute__ ((regparm (2)));
|
void set_normalized_path (const char *) __attribute__ ((regparm (2)));
|
||||||
DWORD get_symlink_length () { return symlink_length; };
|
DWORD get_symlink_length () { return symlink_length; };
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue