VirtualBox

Changeset 77854 in vbox for trunk/include


Ignore:
Timestamp:
Mar 22, 2019 10:23:36 PM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Cleaned up init(), moving the file system registration to the end of everything to avoid races. Also coverted the UTF-8 and symlinks setting to fast HGCM requests. bugref:9172

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuestLibSharedFoldersInline.h

    r77853 r77854  
    104104}
    105105
    106 
    107106/**
    108107 * SHFL_FN_QUERY_FEATURES request, simplified version.
     
    125124}
    126125
     126
     127/** Request structure for VbglR0SfHostReqSetUtf8 and VbglR0SfHostReqSetSymlink. */
     128typedef struct VBOXSFNOPARMS
     129{
     130    VBGLIOCIDCHGCMFASTCALL  Hdr;
     131    VMMDevHGCMCall          Call;
     132    /* no parameters */
     133} VBOXSFNOPARMS;
     134
     135/**
     136 * Worker for request without any parameters.
     137 */
     138DECLINLINE(int) VbglR0SfHostReqNoParms(VBOXSFNOPARMS *pReq, uint32_t uFunction, uint32_t cParms)
     139{
     140    VBGLIOCIDCHGCMFASTCALL_INIT(&pReq->Hdr, VbglR0PhysHeapGetPhysAddr(pReq), &pReq->Call, g_SfClient.idClient,
     141                                uFunction, cParms, sizeof(*pReq));
     142    int vrc = VbglR0HGCMFastCall(g_SfClient.handle, &pReq->Hdr, sizeof(*pReq));
     143    if (RT_SUCCESS(vrc))
     144        vrc = pReq->Call.header.result;
     145    return vrc;
     146}
     147
     148/**
     149 * Worker for request without any parameters, simplified.
     150 */
     151DECLINLINE(int) VbglR0SfHostReqNoParmsSimple(uint32_t uFunction, uint32_t cParms)
     152{
     153    VBOXSFNOPARMS *pReq = (VBOXSFNOPARMS *)VbglR0PhysHeapAlloc(sizeof(*pReq));
     154    if (pReq)
     155    {
     156        int vrc = VbglR0SfHostReqNoParms(pReq, uFunction, cParms);
     157        VbglR0PhysHeapFree(pReq);
     158        return vrc;
     159    }
     160    return VERR_NO_MEMORY;
     161}
     162
     163
     164/**
     165 * SHFL_F_SET_UTF8 request.
     166 */
     167DECLINLINE(int) VbglR0SfHostReqSetUtf8(VBOXSFNOPARMS *pReq)
     168{
     169    return VbglR0SfHostReqNoParms(pReq, SHFL_FN_SET_UTF8, SHFL_CPARMS_SET_UTF8);
     170}
     171
     172/**
     173 * SHFL_F_SET_UTF8 request, simplified version.
     174 */
     175DECLINLINE(int) VbglR0SfHostReqSetUtf8Simple(void)
     176{
     177    return VbglR0SfHostReqNoParmsSimple(SHFL_FN_SET_UTF8, SHFL_CPARMS_SET_UTF8);
     178}
     179
     180
     181/**
     182 * SHFL_F_SET_SYMLINKS request.
     183 */
     184DECLINLINE(int) VbglR0SfHostReqSetSymlinks(VBOXSFNOPARMS *pReq)
     185{
     186    return VbglR0SfHostReqNoParms(pReq, SHFL_FN_SET_SYMLINKS, SHFL_CPARMS_SET_SYMLINKS);
     187}
     188
     189/**
     190 * SHFL_F_SET_SYMLINKS request, simplified version.
     191 */
     192DECLINLINE(int) VbglR0SfHostReqSetSymlinksSimple(void)
     193{
     194    return VbglR0SfHostReqNoParmsSimple(SHFL_FN_SET_SYMLINKS, SHFL_CPARMS_SET_SYMLINKS);
     195}
    127196
    128197
  • trunk/include/VBox/shflsvc.h

    r77848 r77854  
    15111511
    15121512
     1513/** @name SHFL_FN_SET_UTF8
     1514 * @{ */
     1515/** NUmber of parameters for SHFL_FN_SET_UTF8.   */
     1516#define SHFL_CPARMS_SET_UTF8 (0)
     1517/** @} */
     1518
     1519
    15131520/** @name SHFL_FN_LIST
    15141521 * @remarks Listing information includes variable length RTDIRENTRY[EX]
     
    18421849
    18431850
     1851/** @name SHFL_FN_SET_SYMLINKS
     1852 * @{ */
     1853/** NUmber of parameters for SHFL_FN_SET_SYMLINKS.   */
     1854#define SHFL_CPARMS_SET_SYMLINKS (0)
     1855/** @} */
     1856
     1857
    18441858/** @name SHFL_FN_QUERY_MAP_INFO
    18451859 * @{
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