Changeset 32553 in vbox for trunk/include/VBox
- Timestamp:
- Sep 16, 2010 12:07:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxHDD.h
r32536 r32553 253 253 /** Interface to pass error message to upper layers. Per-disk. */ 254 254 VDINTERFACETYPE_ERROR = VDINTERFACETYPE_FIRST, 255 /** Interface for asynchronousI/O operations. Per-disk. */256 VDINTERFACETYPE_ ASYNCIO,255 /** Interface for I/O operations. Per-disk. */ 256 VDINTERFACETYPE_IO, 257 257 /** Interface for progress notification. Per-operation. */ 258 258 VDINTERFACETYPE_PROGRESS, … … 265 265 /** Interface for synchronizing accesses from several threads. Per-disk. */ 266 266 VDINTERFACETYPE_THREADSYNC, 267 /** Interface for I/O between the generic VBoxHDD code and the backend. Per-image. */ 268 VDINTERFACETYPE_IO, 267 /** Interface for I/O between the generic VBoxHDD code and the backend. Per-image (internal). 268 * This interface is completely internal and must not be used elsewhere. */ 269 VDINTERFACETYPE_IOINT, 269 270 /** invalid interface. */ 270 271 VDINTERFACETYPE_INVALID … … 506 507 507 508 /** 508 * Support interface for asynchronousI/O509 * 510 * Per-disk. Optional .511 */ 512 typedef struct VDINTERFACE ASYNCIO509 * Support interface for I/O 510 * 511 * Per-disk. Optional as input. 512 */ 513 typedef struct VDINTERFACEIO 513 514 { 514 515 /** … … 555 556 556 557 /** 558 * Delete callback. 559 * 560 * @return VBox status code. 561 * @param pvUser The opaque data passed on container creation. 562 * @param pcszFilename Name of the file to delete. 563 */ 564 DECLR3CALLBACKMEMBER(int, pfnDelete, (void *pvUser, const char *pcszFilename)); 565 566 /** 567 * Move callback. 568 * 569 * @return VBox status code. 570 * @param pvUser The opaque data passed on container creation. 571 * @param pcszSrc The path to the source file. 572 * @param pcszDst The path to the destination file. 573 * This file will be created. 574 * @param fMove A combination of the RTFILEMOVE_* flags. 575 */ 576 DECLR3CALLBACKMEMBER(int, pfnMove, (void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)); 577 578 /** 579 * Returns the free space on a disk. 580 * 581 * @return VBox status code. 582 * @param pvUser The opaque data passed on container creation. 583 * @param pcszFilename Name of a file to identify the disk. 584 * @param pcbFreeSpace Where to store the free space of the disk. 585 */ 586 DECLR3CALLBACKMEMBER(int, pfnGetFreeSpace, (void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)); 587 588 /** 589 * Returns the last modification timestamp of a file. 590 * 591 * @return VBox status code. 592 * @param pvUser The opaque data passed on container creation. 593 * @param pcszFilename Name of a file to identify the disk. 594 * @param pModificationTime Where to store the timestamp of the file. 595 */ 596 DECLR3CALLBACKMEMBER(int, pfnGetModificationTime, (void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)); 597 598 /** 557 599 * Returns the size of the opened storage backend. 558 600 * … … 660 702 void *pvCompletion, void **ppTask)); 661 703 662 } VDINTERFACE ASYNCIO, *PVDINTERFACEASYNCIO;704 } VDINTERFACEIO, *PVDINTERFACEIO; 663 705 664 706 /** … … 668 710 * @param pInterface Pointer to the interface descriptor. 669 711 */ 670 DECLINLINE(PVDINTERFACE ASYNCIO) VDGetInterfaceAsyncIO(PVDINTERFACE pInterface)671 { 672 PVDINTERFACE ASYNCIO pInterfaceAsyncIO;712 DECLINLINE(PVDINTERFACEIO) VDGetInterfaceIO(PVDINTERFACE pInterface) 713 { 714 PVDINTERFACEIO pInterfaceIO; 673 715 674 716 /* Check that the interface descriptor is a async I/O interface. */ 675 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_ ASYNCIO)717 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_IO) 676 718 && (pInterface->cbSize == sizeof(VDINTERFACE)), 677 719 ("Not an async I/O interface"), NULL); 678 720 679 pInterface AsyncIO = (PVDINTERFACEASYNCIO)pInterface->pCallbacks;721 pInterfaceIO = (PVDINTERFACEIO)pInterface->pCallbacks; 680 722 681 723 /* Do basic checks. */ 682 AssertMsgReturn( (pInterface AsyncIO->cbSize == sizeof(VDINTERFACEASYNCIO))683 && (pInterface AsyncIO->enmInterface == VDINTERFACETYPE_ASYNCIO),684 ("A non async I/O callback table attached to a asyncI/O interface descriptor\n"), NULL);685 686 return pInterface AsyncIO;724 AssertMsgReturn( (pInterfaceIO->cbSize == sizeof(VDINTERFACEIO)) 725 && (pInterfaceIO->enmInterface == VDINTERFACETYPE_IO), 726 ("A non async I/O callback table attached to a I/O interface descriptor\n"), NULL); 727 728 return pInterfaceIO; 687 729 } 688 730 … … 1547 1589 1548 1590 /** 1549 * Support interface for file I/O1550 * 1551 * Per-image. Optional as input, always passed to backends.1552 */ 1553 typedef struct VDINTERFACEIO 1554 { 1555 /** 1556 * Size of the I/O interface.1591 * Internal I/O interface between the generic VD layer and the backends. 1592 * 1593 * Per-image. Always passed to backends. 1594 */ 1595 typedef struct VDINTERFACEIOINT 1596 { 1597 /** 1598 * Size of the internal I/O interface. 1557 1599 */ 1558 1600 uint32_t cbSize; … … 1856 1898 DECLR3CALLBACKMEMBER(void, pfnIoCtxCompleted, (void *pvUser, PVDIOCTX pIoCtx, 1857 1899 int rcReq, size_t cbCompleted)); 1858 } VDINTERFACEIO , *PVDINTERFACEIO;1859 1860 /** 1861 * Get asyncI/O interface from opaque callback table.1900 } VDINTERFACEIOINT, *PVDINTERFACEIOINT; 1901 1902 /** 1903 * Get internal I/O interface from opaque callback table. 1862 1904 * 1863 1905 * @return Pointer to the callback table. 1864 1906 * @param pInterface Pointer to the interface descriptor. 1865 1907 */ 1866 DECLINLINE(PVDINTERFACEIO ) VDGetInterfaceIO(PVDINTERFACE pInterface)1867 { 1868 PVDINTERFACEIO pInterfaceIO;1908 DECLINLINE(PVDINTERFACEIOINT) VDGetInterfaceIOInt(PVDINTERFACE pInterface) 1909 { 1910 PVDINTERFACEIOINT pInterfaceIO; 1869 1911 1870 1912 /* Check that the interface descriptor is a async I/O interface. */ 1871 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_IO )1913 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_IOINT) 1872 1914 && (pInterface->cbSize == sizeof(VDINTERFACE)), 1873 1915 ("Not an I/O interface"), NULL); 1874 1916 1875 pInterfaceIO = (PVDINTERFACEIO )pInterface->pCallbacks;1917 pInterfaceIO = (PVDINTERFACEIOINT)pInterface->pCallbacks; 1876 1918 1877 1919 /* Do basic checks. */ 1878 AssertMsgReturn( (pInterfaceIO->cbSize == sizeof(VDINTERFACEIO ))1879 && (pInterfaceIO->enmInterface == VDINTERFACETYPE_IO ),1920 AssertMsgReturn( (pInterfaceIO->cbSize == sizeof(VDINTERFACEIOINT)) 1921 && (pInterfaceIO->enmInterface == VDINTERFACETYPE_IOINT), 1880 1922 ("A non I/O callback table attached to a I/O interface descriptor\n"), NULL); 1881 1923
Note:
See TracChangeset
for help on using the changeset viewer.