VirtualBox

Changeset 78382 in vbox for trunk


Ignore:
Timestamp:
May 5, 2019 5:23:17 AM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Explanation as to why renaming is slow. bugref:9172

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp

    r78381 r78382  
    11491149    ULONG                       cbToCopy          = 0;
    11501150
    1151     Log(("VBOXSF: MrxQueryFileInfo: Buffer = %p, Length = %x (%d) bytes, FileInformationClass = %d\n",
     1151    Log(("VBOXSF: VBoxMRxQueryFileInfo: Buffer = %p, Length = %x (%d) bytes, FileInformationClass = %d\n",
    11521152         RxContext->Info.Buffer, RxContext->Info.Length, RxContext->Info.Length, RxContext->Info.FileInformationClass));
    11531153
     
    11711171            PFILE_NAMES_INFORMATION pInfo    = (PFILE_NAMES_INFORMATION)RxContext->Info.Buffer;
    11721172            PUNICODE_STRING         FileName = GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(RxContext);
    1173             Log(("VBOXSF: MrxQueryFileInfo: FileNamesInformation\n"));
     1173            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileNamesInformation\n"));
    11741174
    11751175            cbToCopy = RT_UOFFSETOF_DYN(FILE_NAMES_INFORMATION, FileName[FileName->Length / 2 + 1]);
     
    11881188        {
    11891189            PFILE_INTERNAL_INFORMATION pInfo = (PFILE_INTERNAL_INFORMATION)RxContext->Info.Buffer;
    1190             Log(("VBOXSF: MrxQueryFileInfo: FileInternalInformation\n"));
     1190            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileInternalInformation\n"));
    11911191
    11921192            cbToCopy = sizeof(FILE_INTERNAL_INFORMATION);
     
    12011201        {
    12021202            PFILE_EA_INFORMATION pInfo = (PFILE_EA_INFORMATION)RxContext->Info.Buffer;
    1203             Log(("VBOXSF: MrxQueryFileInfo: FileEaInformation\n"));
     1203            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileEaInformation\n"));
    12041204
    12051205            cbToCopy = sizeof(FILE_EA_INFORMATION);
     
    12111211
    12121212        case FileStreamInformation:
    1213             Log(("VBOXSF: MrxQueryFileInfo: FileStreamInformation: not supported\n"));
     1213            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileStreamInformation: not supported\n"));
    12141214            Status = STATUS_INVALID_PARAMETER;
    12151215            break;
    12161216
    12171217        case FileAlternateNameInformation:
    1218             Log(("VBOXSF: MrxQueryFileInfo: FileStreamInformation: not implemented\n"));
     1218            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileStreamInformation: not implemented\n"));
    12191219            Status = STATUS_OBJECT_NAME_NOT_FOUND;
    12201220            break;
    12211221
    12221222        case FileNumaNodeInformation:
    1223             Log(("VBOXSF: MrxQueryFileInfo: FileNumaNodeInformation: not supported\n"));
     1223            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileNumaNodeInformation: not supported\n"));
    12241224            Status = STATUS_NO_SUCH_DEVICE; /* what's returned on a samba share */
    12251225            break;
    12261226
    12271227        case FileStandardLinkInformation:
    1228             Log(("VBOXSF: MrxQueryFileInfo: FileStandardLinkInformation: not supported\n"));
     1228            Log(("VBOXSF: VBoxMRxQueryFileInfo: FileStandardLinkInformation: not supported\n"));
    12291229            Status = STATUS_NOT_SUPPORTED; /* what's returned on a samba share */
    12301230            break;
     
    12831283                {
    12841284                    PFILE_BASIC_INFORMATION pInfo = (PFILE_BASIC_INFORMATION)RxContext->Info.Buffer;
    1285                     Log(("VBOXSF: MrxQueryFileInfo: FileBasicInformation\n"));
     1285                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileBasicInformation\n"));
    12861286
    12871287                    cbToCopy = sizeof(FILE_BASIC_INFORMATION);
     
    12931293                    pInfo->ChangeTime.QuadPart     = RTTimeSpecGetNtTime(&pVBoxFobx->Info.ChangeTime);
    12941294                    pInfo->FileAttributes          = VBoxToNTFileAttributes(pVBoxFobx->Info.Attr.fMode);
    1295                     Log(("VBOXSF: MrxQueryFileInfo: FileBasicInformation: File attributes: 0x%x\n",
     1295                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileBasicInformation: File attributes: 0x%x\n",
    12961296                         pInfo->FileAttributes));
    12971297                    break;
     
    13011301                {
    13021302                    PFILE_STANDARD_INFORMATION pInfo = (PFILE_STANDARD_INFORMATION)RxContext->Info.Buffer;
    1303                     Log(("VBOXSF: MrxQueryFileInfo: FileStandardInformation\n"));
     1303                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileStandardInformation\n"));
    13041304
    13051305                    cbToCopy = sizeof(FILE_STANDARD_INFORMATION);
     
    13191319                {
    13201320                    PFILE_NETWORK_OPEN_INFORMATION pInfo = (PFILE_NETWORK_OPEN_INFORMATION)RxContext->Info.Buffer;
    1321                     Log(("VBOXSF: MrxQueryFileInfo: FileNetworkOpenInformation\n"));
     1321                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileNetworkOpenInformation\n"));
    13221322
    13231323                    cbToCopy = sizeof(FILE_NETWORK_OPEN_INFORMATION);
     
    13391339                {
    13401340                    PFILE_END_OF_FILE_INFORMATION pInfo = (PFILE_END_OF_FILE_INFORMATION)RxContext->Info.Buffer;
    1341                     Log(("VBOXSF: MrxQueryFileInfo: FileEndOfFileInformation\n"));
     1341                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileEndOfFileInformation\n"));
    13421342
    13431343                    cbToCopy = sizeof(FILE_END_OF_FILE_INFORMATION);
     
    13531353                {
    13541354                    PFILE_ALLOCATION_INFORMATION pInfo = (PFILE_ALLOCATION_INFORMATION)RxContext->Info.Buffer;
    1355                     Log(("VBOXSF: MrxQueryFileInfo: FileAllocationInformation\n"));
     1355                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileAllocationInformation\n"));
    13561356
    13571357                    cbToCopy = sizeof(FILE_ALLOCATION_INFORMATION);
     
    13671367                {
    13681368                    PFILE_ATTRIBUTE_TAG_INFORMATION pInfo = (PFILE_ATTRIBUTE_TAG_INFORMATION)RxContext->Info.Buffer;
    1369                     Log(("VBOXSF: MrxQueryFileInfo: FileAttributeTagInformation\n"));
     1369                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileAttributeTagInformation\n"));
    13701370
    13711371                    cbToCopy = sizeof(FILE_ATTRIBUTE_TAG_INFORMATION);
     
    13891389                        UCHAR           Reserved[3];
    13901390                    } *pInfo = (struct MY_FILE_COMPRESSION_INFO *)RxContext->Info.Buffer;
    1391                     Log(("VBOXSF: MrxQueryFileInfo: FileCompressionInformation\n"));
     1391                    Log(("VBOXSF: VBoxMRxQueryFileInfo: FileCompressionInformation\n"));
    13921392
    13931393                    cbToCopy = sizeof(*pInfo);
     
    14201420 * FileProcessIdsUsingFileInformation: rcNt=0 (STATUS_SUCCESS) Ios.Status=0 (STATUS_SUCCESS) Ios.Information=0000000000000010
    14211421 * FileNormalizedNameInformation: rcNt=0 (STATUS_SUCCESS) Ios.Status=0 (STATUS_SUCCESS) Ios.Information=00000000000000AA
     1422 *  => See during MoveFileEx call on W10.
    14221423 * FileNetworkPhysicalNameInformation: rcNt=0xc000000d (STATUS_INVALID_PARAMETER) Ios={not modified}
    14231424 * FileShortNameInformation?
     
    14311432         */
    14321433        default:
    1433             Log(("VBOXSF: MrxQueryFileInfo: Not supported FileInformationClass: %d!\n",
     1434            Log(("VBOXSF: VBoxMRxQueryFileInfo: Not supported FileInformationClass: %d!\n",
    14341435                 RxContext->Info.FileInformationClass));
    14351436            Status = STATUS_INVALID_PARAMETER;
     
    14461447    AssertStmt(RxContext->Info.LengthRemaining >= 0 || Status != STATUS_SUCCESS, Status = STATUS_BUFFER_TOO_SMALL);
    14471448
    1448     Log(("VBOXSF: MrxQueryFileInfo: Returns %#x, Remaining length = %d, cbToCopy = %u (%#x)\n",
     1449    Log(("VBOXSF: VBoxMRxQueryFileInfo: Returns %#x, Remaining length = %d, cbToCopy = %u (%#x)\n",
    14491450         Status, RxContext->Info.Length, cbToCopy));
    14501451    return Status;
     
    17061707
    17071708/**
    1708  * Worker for VBoxMRxSetFileInfo.
     1709 * Worker for VBoxMRxSetFileInfo handling FileRenameInformation.
    17091710 *
    1710  * @todo Renaming files from the guest is _very_ expensive:
    1711  *           52175 ns/call on the host
    1712  *          844237 ns/call from the guest
     1711 * @note    Renaming files from the guest is _very_ expensive:
     1712 *              -  52175 ns/call on the host
     1713 *              - 844237 ns/call from the guest
     1714 *
     1715 *          The explanation for this is that RTPathRename translates to a
     1716 *          MoveFileEx call, which ends up doing a lot more than opening the
     1717 *          file and setting rename information on that handle (W10):
     1718 *              - Opens the file.
     1719 *              - Queries FileAllInformation.
     1720 *              - Tries to open the new filename (result: 0x00000000 but not
     1721 *                opened by our code - weird).
     1722 *              - Does IOCTL_REDIR_QUERY_PATH_EX on \vboxsvr\IPC$.
     1723 *              - Tries to open \vboxsvr\IPC$ (result: 0xc0000016)
     1724 *              - Opens the parent directory.
     1725 *              - Queries directory info with old name as filter.
     1726 *              - Closes parent directory handle.
     1727 *              - Finally does FileRenameInformation.
     1728 *              - Closes the handle to the renamed file.
     1729 *
    17131730 */
    17141731static NTSTATUS vbsfNtRename(IN PRX_CONTEXT RxContext,
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.cpp

    r78368 r78382  
    447447    NTSTATUS                    rcNt;
    448448
    449     Log(("VBOXSF: VBoxHookMjCreate: pDevObj %p, pDevExt %p, pFileObj %p, options %#x, attr %#x, share %#x, ealength %#x, secctx %p\n",
     449    Log(("VBOXSF: VBoxHookMjCreate: pDevObj %p, pDevExt %p, pFileObj %p, options %#x, attr %#x, share %#x, ealength %#x, secctx %p, IrpFlags %#x\n",
    450450         pDevObj, pDevObj->DeviceExtension, pFileObj, pStack->Parameters.Create.Options, pStack->Parameters.Create.FileAttributes,
    451          pStack->Parameters.Create.ShareAccess, pStack->Parameters.Create.EaLength, pStack->Parameters.Create.SecurityContext));
     451         pStack->Parameters.Create.ShareAccess, pStack->Parameters.Create.EaLength, pStack->Parameters.Create.SecurityContext, pIrp->Flags));
    452452    if (pFileObj)
    453453        Log(("VBOXSF: VBoxHookMjCreate: FileName=%.*ls\n", pFileObj->FileName.Length / sizeof(WCHAR), pFileObj->FileName.Buffer));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette