Changeset 44233 in vbox for trunk/include/VBox
- Timestamp:
- Jan 4, 2013 8:39:56 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83076
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd-ifs-internal.h
r38469 r44233 210 210 211 211 /** 212 * Synchronous write callback. 213 * 214 * @return VBox status code. 215 * @param pvUser The opaque data passed on container creation. 216 * @param pStorage The storage handle to use. 217 * @param uOffset The offset to start from. 218 * @param pvBuffer Pointer to the bits need to be written. 219 * @param cbBuffer How many bytes to write. 220 * @param pcbWritten Where to store how many bytes were actually written. 221 * 222 * @notes Do not use in code called from the async read/write entry points in the backends. 223 * This should be only used during open/close of images and for the support functions 224 * which are not called while a VM is running (pfnCompact). 225 */ 226 DECLR3CALLBACKMEMBER(int, pfnWriteSync, (void *pvUser, PVDIOSTORAGE pStorage, uint64_t uOffset, 227 const void *pvBuffer, size_t cbBuffer, size_t *pcbWritten)); 228 229 /** 230 * Synchronous read callback. 231 * 232 * @return VBox status code. 233 * @param pvUser The opaque data passed on container creation. 234 * @param pStorage The storage handle to use. 235 * @param uOffset The offset to start from. 236 * @param pvBuffer Where to store the read bits. 237 * @param cbBuffer How many bytes to read. 238 * @param pcbRead Where to store how many bytes were actually read. 239 * 240 * @notes See pfnWriteSync() 241 */ 242 DECLR3CALLBACKMEMBER(int, pfnReadSync, (void *pvUser, PVDIOSTORAGE pStorage, uint64_t uOffset, 243 void *pvBuffer, size_t cbBuffer, size_t *pcbRead)); 244 245 /** 246 * Flush data to the storage backend. 247 * 248 * @return VBox status code. 249 * @param pvUser The opaque data passed on container creation. 250 * @param pStorage The storage handle to flush. 251 * 252 * @notes See pfnWriteSync() 253 */ 254 DECLR3CALLBACKMEMBER(int, pfnFlushSync, (void *pvUser, PVDIOSTORAGE pStorage)); 255 256 /** 257 * Initiate an asynchronous read request for user data. 212 * Initiate a read request for user data. 258 213 * 259 214 * @return VBox status code. … … 261 216 * @param pStorage The storage handle. 262 217 * @param uOffset The offset to start reading from. 263 * @param pIoCtx I/O context passed in VDAsyncRead/Write.218 * @param pIoCtx I/O context passed in the read/write callback. 264 219 * @param cbRead How many bytes to read. 265 220 */ 266 DECLR3CALLBACKMEMBER(int, pfnReadUser Async, (void *pvUser, PVDIOSTORAGE pStorage,267 268 269 270 /** 271 * Initiate a n asynchronouswrite request for user data.221 DECLR3CALLBACKMEMBER(int, pfnReadUser, (void *pvUser, PVDIOSTORAGE pStorage, 222 uint64_t uOffset, PVDIOCTX pIoCtx, 223 size_t cbRead)); 224 225 /** 226 * Initiate a write request for user data. 272 227 * 273 228 * @return VBox status code. … … 275 230 * @param pStorage The storage handle. 276 231 * @param uOffset The offset to start writing to. 277 * @param pIoCtx I/O context passed in VDAsyncRead/Write232 * @param pIoCtx I/O context passed in the read/write callback. 278 233 * @param cbWrite How many bytes to write. 279 234 * @param pfnCompleted Completion callback. 280 235 * @param pvCompleteUser Opaque user data passed in the completion callback. 281 236 */ 282 DECLR3CALLBACKMEMBER(int, pfnWriteUser Async, (void *pvUser, PVDIOSTORAGE pStorage,283 284 285 286 287 288 /** 289 * Reads metadata asynchronouslyfrom storage.237 DECLR3CALLBACKMEMBER(int, pfnWriteUser, (void *pvUser, PVDIOSTORAGE pStorage, 238 uint64_t uOffset, PVDIOCTX pIoCtx, 239 size_t cbWrite, 240 PFNVDXFERCOMPLETED pfnComplete, 241 void *pvCompleteUser)); 242 243 /** 244 * Reads metadata from storage. 290 245 * The current I/O context will be halted. 291 246 * … … 300 255 * @param pfnCompleted Completion callback. 301 256 * @param pvCompleteUser Opaque user data passed in the completion callback. 302 */ 303 DECLR3CALLBACKMEMBER(int, pfnReadMetaAsync, (void *pvUser, PVDIOSTORAGE pStorage, 304 uint64_t uOffset, void *pvBuffer, 305 size_t cbBuffer, PVDIOCTX pIoCtx, 306 PPVDMETAXFER ppMetaXfer, 307 PFNVDXFERCOMPLETED pfnComplete, 308 void *pvCompleteUser)); 309 310 /** 311 * Writes metadata asynchronously to storage. 257 * 258 * @notes If pIoCtx is NULL the metadata read is handled synchronously 259 * i.e. the call returns only if the data is available in the given 260 * buffer. ppMetaXfer, pfnCompleted and pvCompleteUser are ignored in that case. 261 * Use the synchronous version only when opening/closing the image 262 * or when doing certain operations like resizing, compacting or repairing 263 * the disk. 264 */ 265 DECLR3CALLBACKMEMBER(int, pfnReadMeta, (void *pvUser, PVDIOSTORAGE pStorage, 266 uint64_t uOffset, void *pvBuffer, 267 size_t cbBuffer, PVDIOCTX pIoCtx, 268 PPVDMETAXFER ppMetaXfer, 269 PFNVDXFERCOMPLETED pfnComplete, 270 void *pvCompleteUser)); 271 272 /** 273 * Writes metadata to storage. 312 274 * 313 275 * @returns VBox status code. … … 320 282 * @param pfnCompleted Completion callback. 321 283 * @param pvCompleteUser Opaque user data passed in the completion callback. 322 */ 323 DECLR3CALLBACKMEMBER(int, pfnWriteMetaAsync, (void *pvUser, PVDIOSTORAGE pStorage, 324 uint64_t uOffset, void *pvBuffer, 325 size_t cbBuffer, PVDIOCTX pIoCtx, 326 PFNVDXFERCOMPLETED pfnComplete, 327 void *pvCompleteUser)); 284 * 285 * @notes See pfnReadMeta(). 286 */ 287 DECLR3CALLBACKMEMBER(int, pfnWriteMeta, (void *pvUser, PVDIOSTORAGE pStorage, 288 uint64_t uOffset, const void *pvBuffer, 289 size_t cbBuffer, PVDIOCTX pIoCtx, 290 PFNVDXFERCOMPLETED pfnComplete, 291 void *pvCompleteUser)); 328 292 329 293 /** … … 338 302 339 303 /** 340 * Initiates a n asyncflush request.304 * Initiates a flush request. 341 305 * 342 306 * @return VBox status code. … … 346 310 * @param pfnCompleted Completion callback. 347 311 * @param pvCompleteUser Opaque user data passed in the completion callback. 348 */ 349 DECLR3CALLBACKMEMBER(int, pfnFlushAsync, (void *pvUser, PVDIOSTORAGE pStorage, 350 PVDIOCTX pIoCtx, 351 PFNVDXFERCOMPLETED pfnComplete, 352 void *pvCompleteUser)); 312 * 313 * @notes See pfnReadMeta(). 314 */ 315 DECLR3CALLBACKMEMBER(int, pfnFlush, (void *pvUser, PVDIOSTORAGE pStorage, 316 PVDIOCTX pIoCtx, 317 PFNVDXFERCOMPLETED pfnComplete, 318 void *pvCompleteUser)); 353 319 354 320 /** … … 484 450 485 451 DECLINLINE(int) vdIfIoIntFileWriteSync(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 486 uint64_t uOffset, const void *pvBuffer, size_t cbBuffer ,487 size_t *pcbWritten) 488 { 489 return pIfIoInt->pfnWriteSync(pIfIoInt->Core.pvUser, pStorage, uOffset,490 pvBuffer, cbBuffer, pcbWritten);452 uint64_t uOffset, const void *pvBuffer, size_t cbBuffer) 453 { 454 return pIfIoInt->pfnWriteMeta(pIfIoInt->Core.pvUser, pStorage, 455 uOffset, pvBuffer, cbBuffer, NULL, 456 NULL, NULL); 491 457 } 492 458 493 459 DECLINLINE(int) vdIfIoIntFileReadSync(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 494 uint64_t uOffset, void *pvBuffer, size_t cbBuffer ,495 size_t *pcbRead) 496 { 497 return pIfIoInt->pfnReadSync(pIfIoInt->Core.pvUser, pStorage, uOffset,498 pvBuffer, cbBuffer, pcbRead);460 uint64_t uOffset, void *pvBuffer, size_t cbBuffer) 461 { 462 return pIfIoInt->pfnReadMeta(pIfIoInt->Core.pvUser, pStorage, 463 uOffset, pvBuffer, cbBuffer, NULL, 464 NULL, NULL, NULL); 499 465 } 500 466 501 467 DECLINLINE(int) vdIfIoIntFileFlushSync(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage) 502 468 { 503 return pIfIoInt->pfnFlush Sync(pIfIoInt->Core.pvUser, pStorage);504 } 505 506 DECLINLINE(int) vdIfIoIntFileReadUser Async(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,507 508 { 509 return pIfIoInt->pfnReadUser Async(pIfIoInt->Core.pvUser, pStorage,510 511 } 512 513 DECLINLINE(int) vdIfIoIntFileWriteUser Async(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,514 515 516 517 { 518 return pIfIoInt->pfnWriteUser Async(pIfIoInt->Core.pvUser, pStorage,519 520 521 } 522 523 DECLINLINE(int) vdIfIoIntFileReadMeta Async(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,524 525 526 527 528 529 { 530 return pIfIoInt->pfnReadMeta Async(pIfIoInt->Core.pvUser, pStorage,531 532 533 } 534 535 DECLINLINE(int) vdIfIoIntFileWriteMeta Async(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,536 537 538 539 540 { 541 return pIfIoInt->pfnWriteMeta Async(pIfIoInt->Core.pvUser, pStorage,542 543 469 return pIfIoInt->pfnFlush(pIfIoInt->Core.pvUser, pStorage, NULL, NULL, NULL); 470 } 471 472 DECLINLINE(int) vdIfIoIntFileReadUser(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 473 uint64_t uOffset, PVDIOCTX pIoCtx, size_t cbRead) 474 { 475 return pIfIoInt->pfnReadUser(pIfIoInt->Core.pvUser, pStorage, 476 uOffset, pIoCtx, cbRead); 477 } 478 479 DECLINLINE(int) vdIfIoIntFileWriteUser(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 480 uint64_t uOffset, PVDIOCTX pIoCtx, size_t cbWrite, 481 PFNVDXFERCOMPLETED pfnComplete, 482 void *pvCompleteUser) 483 { 484 return pIfIoInt->pfnWriteUser(pIfIoInt->Core.pvUser, pStorage, 485 uOffset, pIoCtx, cbWrite, pfnComplete, 486 pvCompleteUser); 487 } 488 489 DECLINLINE(int) vdIfIoIntFileReadMeta(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 490 uint64_t uOffset, void *pvBuffer, 491 size_t cbBuffer, PVDIOCTX pIoCtx, 492 PPVDMETAXFER ppMetaXfer, 493 PFNVDXFERCOMPLETED pfnComplete, 494 void *pvCompleteUser) 495 { 496 return pIfIoInt->pfnReadMeta(pIfIoInt->Core.pvUser, pStorage, 497 uOffset, pvBuffer, cbBuffer, pIoCtx, 498 ppMetaXfer, pfnComplete, pvCompleteUser); 499 } 500 501 DECLINLINE(int) vdIfIoIntFileWriteMeta(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 502 uint64_t uOffset, void *pvBuffer, 503 size_t cbBuffer, PVDIOCTX pIoCtx, 504 PFNVDXFERCOMPLETED pfnComplete, 505 void *pvCompleteUser) 506 { 507 return pIfIoInt->pfnWriteMeta(pIfIoInt->Core.pvUser, pStorage, 508 uOffset, pvBuffer, cbBuffer, pIoCtx, 509 pfnComplete, pvCompleteUser); 544 510 } 545 511 … … 549 515 } 550 516 551 DECLINLINE(int) vdIfIoIntFileFlush Async(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage,552 553 554 { 555 return pIfIoInt->pfnFlush Async(pIfIoInt->Core.pvUser, pStorage, pIoCtx, pfnComplete,556 517 DECLINLINE(int) vdIfIoIntFileFlush(PVDINTERFACEIOINT pIfIoInt, PVDIOSTORAGE pStorage, 518 PVDIOCTX pIoCtx, PFNVDXFERCOMPLETED pfnComplete, 519 void *pvCompleteUser) 520 { 521 return pIfIoInt->pfnFlush(pIfIoInt->Core.pvUser, pStorage, pIoCtx, pfnComplete, 522 pvCompleteUser); 557 523 } 558 524
Note:
See TracChangeset
for help on using the changeset viewer.