Rename FileId to IndexNumber in NT structures to align with upstream

* ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber
        to align with Microsoft naming scheme.
        (FILE_INTERNAL_INFORMATION): Ditto.
        * fhandler_disk_file.cc: Rename FileId to IndexNumber throughout.
        * syscalls.cc: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2015-12-08 14:33:07 +01:00
parent 87db9e0680
commit d0f5f4c422
4 changed files with 20 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2015-12-08 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber
to align with Microsoft naming scheme.
(FILE_INTERNAL_INFORMATION): Ditto.
* fhandler_disk_file.cc: Rename FileId to IndexNumber throughout.
* syscalls.cc: Ditto.
2015-12-07 Johannes Schindelin <johannes.schindelin@gmx.de> 2015-12-07 Johannes Schindelin <johannes.schindelin@gmx.de>
* mount.cc (mount_info::from_fstab_line): Support mounting the current * mount.cc (mount_info::from_fstab_line): Support mounting the current

View File

@ -228,8 +228,8 @@ path_conv::get_ino_by_handle (HANDLE hdl)
if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fai, sizeof fai, if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fai, sizeof fai,
FileInternalInformation)) FileInternalInformation))
&& isgood_inode (fai.FileId.QuadPart)) && isgood_inode (fai.IndexNumber.QuadPart))
return fai.FileId.QuadPart; return fai.IndexNumber.QuadPart;
return 0; return 0;
} }
@ -449,8 +449,8 @@ fhandler_base::fstat_by_handle (struct stat *buf)
status, pc.get_nt_native_path ()); status, pc.get_nt_native_path ());
return -1; return -1;
} }
else if (pc.isgood_inode (fii.FileId.QuadPart)) else if (pc.isgood_inode (fii.IndexNumber.QuadPart))
ino = fii.FileId.QuadPart; ino = fii.IndexNumber.QuadPart;
} }
} }
return fstat_helper (buf, fsi.NumberOfLinks); return fstat_helper (buf, fsi.NumberOfLinks);
@ -494,7 +494,7 @@ fhandler_base::fstat_by_name (struct stat *buf)
debug_printf ("%y = NtQueryDirectoryFile(%S)", status, debug_printf ("%y = NtQueryDirectoryFile(%S)", status,
pc.get_nt_native_path ()); pc.get_nt_native_path ());
else else
ino = fdi_buf.fdi.FileId.QuadPart; ino = fdi_buf.fdi.IndexNumber.QuadPart;
} }
} }
return fstat_helper (buf, 1); return fstat_helper (buf, 1);
@ -2339,7 +2339,7 @@ go_ahead:
FileNameLength = buf->FileNameLength; FileNameLength = buf->FileNameLength;
FileAttributes = buf->FileAttributes; FileAttributes = buf->FileAttributes;
if ((dir->__flags & dirent_set_d_ino)) if ((dir->__flags & dirent_set_d_ino))
de->d_ino = buf->FileId.QuadPart; de->d_ino = buf->IndexNumber.QuadPart;
} }
else if ((dir->__flags & dirent_nfs_d_ino)) else if ((dir->__flags & dirent_nfs_d_ino))
{ {
@ -2413,8 +2413,8 @@ go_ahead:
NtClose (hdl); NtClose (hdl);
if (NT_SUCCESS (f_status)) if (NT_SUCCESS (f_status))
{ {
if (pc.isgood_inode (fai.FileId.QuadPart)) if (pc.isgood_inode (fai.IndexNumber.QuadPart))
de->d_ino = fai.FileId.QuadPart; de->d_ino = fai.IndexNumber.QuadPart;
else else
/* Untrusted file system. Don't try to fetch inode /* Untrusted file system. Don't try to fetch inode
number again. */ number again. */

View File

@ -265,7 +265,7 @@ typedef struct _FILE_ID_BOTH_DIR_INFORMATION
ULONG EaSize; ULONG EaSize;
CCHAR ShortNameLength; CCHAR ShortNameLength;
WCHAR ShortName[12]; WCHAR ShortName[12];
LARGE_INTEGER FileId; LARGE_INTEGER IndexNumber;
WCHAR FileName[1]; WCHAR FileName[1];
} FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION; } FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION;
@ -858,7 +858,7 @@ typedef struct _FILE_NETWORK_OPEN_INFORMATION
/* Checked on 64 bit. */ /* Checked on 64 bit. */
typedef struct _FILE_INTERNAL_INFORMATION typedef struct _FILE_INTERNAL_INFORMATION
{ {
LARGE_INTEGER FileId; LARGE_INTEGER IndexNumber;
} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION; } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
/* Checked on 64 bit. */ /* Checked on 64 bit. */

View File

@ -405,7 +405,7 @@ try_to_bin (path_conv &pc, HANDLE &fh, ACCESS_MASK access, ULONG flags)
"failed, status = %y", pc.get_nt_native_path (), status); "failed, status = %y", pc.get_nt_native_path (), status);
goto out; goto out;
} }
RtlInt64ToHexUnicodeString (pfii->FileId.QuadPart, &recycler, TRUE); RtlInt64ToHexUnicodeString (pfii->IndexNumber.QuadPart, &recycler, TRUE);
RtlInt64ToHexUnicodeString (hash_path_name (0, pc.get_nt_native_path ()), RtlInt64ToHexUnicodeString (hash_path_name (0, pc.get_nt_native_path ()),
&recycler, TRUE); &recycler, TRUE);
/* Shoot. */ /* Shoot. */
@ -2548,7 +2548,7 @@ rename (const char *oldpath, const char *newpath)
&& NT_SUCCESS (NtQueryInformationFile (nfh, &io, &nfii, && NT_SUCCESS (NtQueryInformationFile (nfh, &io, &nfii,
sizeof nfii, sizeof nfii,
FileInternalInformation)) FileInternalInformation))
&& ofii.FileId.QuadPart == nfii.FileId.QuadPart) && ofii.IndexNumber.QuadPart == nfii.IndexNumber.QuadPart)
{ {
debug_printf ("%s and %s are the same file", oldpath, newpath); debug_printf ("%s and %s are the same file", oldpath, newpath);
NtClose (nfh); NtClose (nfh);