VirtualBox

Changeset 29111 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 5, 2010 8:28:30 PM (15 years ago)
Author:
vboxsync
Message:

IPRT/fileaio-linux: Support flushes, not supported by any filesystem yet (returns an error)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp

    r28800 r29111  
    7777enum
    7878{
    79     LNXKAIO_IOCB_CMD_READ = 0,
    80     LNXKAIO_IOCB_CMD_WRITE
     79    LNXKAIO_IOCB_CMD_READ   = 0,
     80    LNXKAIO_IOCB_CMD_WRITE  = 1,
     81    LNXKAIO_IOCB_CMD_FSYNC  = 2,
     82    LNXKAIO_IOCB_CMD_FDSYNC = 3
    8183};
    8284
     
    365367    RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
    366368    Assert(hFile != NIL_RTFILE);
    367     AssertPtr(pvBuf);
    368     Assert(off >= 0);
    369     Assert(cbTransfer > 0);
     369
     370    if (uTransferDirection != LNXKAIO_IOCB_CMD_FSYNC)
     371    {
     372        AssertPtr(pvBuf);
     373        Assert(off >= 0);
     374        Assert(cbTransfer > 0);
     375    }
    370376
    371377    /*
     
    409415    RTFILEAIOREQ_NOT_STATE_RETURN_RC(pReqInt, SUBMITTED, VERR_FILE_AIO_IN_PROGRESS);
    410416
    411     /** @todo: Flushing is not neccessary on Linux because O_DIRECT is mandatory
    412      *         which disables caching.
    413      *         We could setup a fake request which isn't really executed
    414      *         to avoid platform dependent code in the caller.
    415      */
    416 #if 0
    417     return rtFileAsyncPrepareTransfer(pRequest, File, TRANSFERDIRECTION_FLUSH,
    418                                       0, NULL, 0, pvUser);
    419 #endif
    420     return VERR_NOT_IMPLEMENTED;
     417    return rtFileAioReqPrepareTransfer(pReqInt, hFile, LNXKAIO_IOCB_CMD_FSYNC,
     418                                       0, NULL, 0, pvUser);
    421419}
    422420
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