VirtualBox

Changeset 27738 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 26, 2010 1:21:55 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59368
Message:

AsyncCompletion: Add a new method to set the size of an endpoint

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletion.cpp

    r26147 r27738  
    10231023                                     STAMUNIT_OCCURENCES,
    10241024                                     "Nanosecond resolution runtime statistics",
    1025                                      "/PDM/AsyncCompletion/File/%s/TaskRunNs-%u-%u",
     1025                                     "/PDM/AsyncCompletion/File/%s/TaskRun1Ns-%u-%u",
    10261026                                     RTPathFilename(pEndpoint->pszUri),
    10271027                                     i*100, i*100+100-1);
     
    10381038                                         STAMUNIT_OCCURENCES,
    10391039                                         "Microsecond resolution runtime statistics",
    1040                                          "/PDM/AsyncCompletion/File/%s/TaskRunMicroSec-%u-%u",
     1040                                         "/PDM/AsyncCompletion/File/%s/TaskRun2MicroSec-%u-%u",
    10411041                                         RTPathFilename(pEndpoint->pszUri),
    10421042                                        i*100, i*100+100-1);
     
    10541054                                         STAMUNIT_OCCURENCES,
    10551055                                         "Milliseconds resolution runtime statistics",
    1056                                          "/PDM/AsyncCompletion/File/%s/TaskRunMs-%u-%u",
     1056                                         "/PDM/AsyncCompletion/File/%s/TaskRun3Ms-%u-%u",
    10571057                                         RTPathFilename(pEndpoint->pszUri),
    10581058                                        i*100, i*100+100-1);
     
    10701070                                         STAMUNIT_OCCURENCES,
    10711071                                         "Second resolution runtime statistics",
    1072                                          "/PDM/AsyncCompletion/File/%s/TaskRunSec-%u-%u",
     1072                                         "/PDM/AsyncCompletion/File/%s/TaskRun4Sec-%u-%u",
    10731073                                         RTPathFilename(pEndpoint->pszUri),
    10741074                                        i*10, i*10+10-1);
     
    13481348    AssertReturn(VALID_PTR(pcbSize), VERR_INVALID_POINTER);
    13491349
    1350     return pEndpoint->pEpClass->pEndpointOps->pfnEpGetSize(pEndpoint, pcbSize);
     1350    if (pEndpoint->pEpClass->pEndpointOps->pfnEpGetSize)
     1351        return pEndpoint->pEpClass->pEndpointOps->pfnEpGetSize(pEndpoint, pcbSize);
     1352    else
     1353        return VERR_NOT_SUPPORTED;
     1354}
     1355
     1356VMMR3DECL(int) PDMR3AsyncCompletionEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
     1357                                             uint64_t cbSize)
     1358{
     1359    AssertReturn(VALID_PTR(pEndpoint), VERR_INVALID_POINTER);
     1360
     1361    if (pEndpoint->pEpClass->pEndpointOps->pfnEpSetSize)
     1362        return pEndpoint->pEpClass->pEndpointOps->pfnEpSetSize(pEndpoint, cbSize);
     1363    else
     1364        return VERR_NOT_SUPPORTED;
    13511365}
    13521366
  • trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp

    r27656 r27738  
    11061106
    11071107    return VINF_SUCCESS;
     1108}
     1109
     1110static int pdmacFileEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t cbSize)
     1111{
     1112    PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
     1113
     1114    ASMAtomicWriteU64(&pEpFile->cbEndpoint, cbSize);
     1115    return RTFileSetSize(pEpFile->File, cbSize);
    11081116}
    11091117
     
    11381146    /* pfnEpGetSize */
    11391147    pdmacFileEpGetSize,
     1148    /* pfnEpSetSize */
     1149    pdmacFileEpSetSize,
    11401150    /* u32VersionEnd */
    11411151    PDMAC_EPCLASS_OPS_VERSION
  • trunk/src/VBox/VMM/PDMAsyncCompletionInternal.h

    r26147 r27738  
    143143
    144144    /**
    145      * Initiates a flush request on the given endpoint.
     145     * Queries the size of the endpoint. Optional.
    146146     *
    147147     * @returns VBox status code.
     
    151151    DECLR3CALLBACKMEMBER(int, pfnEpGetSize, (PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
    152152                                             uint64_t *pcbSize));
     153
     154    /**
     155     * Sets the size of the endpoint. Optional.
     156     * This is a synchronous operation.
     157     *
     158     *
     159     * @returns VBox status code.
     160     * @param   pEndpoint     Endpoint the request is for.
     161     * @param   cbSize        New size for the endpoint.
     162     */
     163    DECLR3CALLBACKMEMBER(int, pfnEpSetSize, (PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
     164                                             uint64_t cbSize));
    153165
    154166    /** Initialization safety marker. */
Note: See TracChangeset for help on using the changeset viewer.

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