VirtualBox

source: vbox/trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h@ 24728

Last change on this file since 24728 was 24621, checked in by vboxsync, 15 years ago

AsyncCompletion: Implement new caching using the 2Q algorithm

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.5 KB
Line 
1/* $Id: PDMAsyncCompletionFileInternal.h 24621 2009-11-12 19:05:01Z vboxsync $ */
2/** @file
3 * PDM Async I/O - Transport data asynchronous in R3 using EMT.
4 */
5
6/*
7 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ___PDMAsyncCompletionFileInternal_h
23#define ___PDMAsyncCompletionFileInternal_h
24
25#include <VBox/cfgm.h>
26#include <VBox/stam.h>
27#include <iprt/types.h>
28#include <iprt/file.h>
29#include <iprt/thread.h>
30#include <iprt/semaphore.h>
31#include <iprt/critsect.h>
32#include <iprt/avl.h>
33
34#include "PDMAsyncCompletionInternal.h"
35
36/** Enable the 2Q cache alogrithm. */
37#define VBOX_WITH_2Q_CACHE 1
38
39/** @todo: Revise the caching of tasks. We have currently four caches:
40 * Per endpoint task cache
41 * Per class cache
42 * Per endpoint task segment cache
43 * Per class task segment cache
44 *
45 * We could use the RT heap for this probably or extend MMR3Heap (uses RTMemAlloc
46 * instead of managing larger blocks) to have this global for the whole VM.
47 */
48
49RT_C_DECLS_BEGIN
50
51/**
52 * A few forward declerations.
53 */
54typedef struct PDMASYNCCOMPLETIONENDPOINTFILE *PPDMASYNCCOMPLETIONENDPOINTFILE;
55/** Pointer to a request segment. */
56typedef struct PDMACTASKFILE *PPDMACTASKFILE;
57/** Pointer to the endpoint class data. */
58typedef struct PDMASYNCCOMPLETIONTASKFILE *PPDMASYNCCOMPLETIONTASKFILE;
59/** Pointer to a cache LRU list. */
60typedef struct PDMACFILELRULIST *PPDMACFILELRULIST;
61/** Pointer to the global cache structure. */
62typedef struct PDMACFILECACHEGLOBAL *PPDMACFILECACHEGLOBAL;
63
64/**
65 * Blocking event types.
66 */
67typedef enum PDMACEPFILEAIOMGRBLOCKINGEVENT
68{
69 /** Invalid tye */
70 PDMACEPFILEAIOMGRBLOCKINGEVENT_INVALID = 0,
71 /** An endpoint is added to the manager. */
72 PDMACEPFILEAIOMGRBLOCKINGEVENT_ADD_ENDPOINT,
73 /** An endpoint is removed from the manager. */
74 PDMACEPFILEAIOMGRBLOCKINGEVENT_REMOVE_ENDPOINT,
75 /** An endpoint is about to be closed. */
76 PDMACEPFILEAIOMGRBLOCKINGEVENT_CLOSE_ENDPOINT,
77 /** The manager is requested to terminate */
78 PDMACEPFILEAIOMGRBLOCKINGEVENT_SHUTDOWN,
79 /** The manager is requested to suspend */
80 PDMACEPFILEAIOMGRBLOCKINGEVENT_SUSPEND,
81 /** The manager is requested to resume */
82 PDMACEPFILEAIOMGRBLOCKINGEVENT_RESUME,
83 /** 32bit hack */
84 PDMACEPFILEAIOMGRBLOCKINGEVENT_32BIT_HACK = 0x7fffffff
85} PDMACEPFILEAIOMGRBLOCKINGEVENT;
86
87/**
88 * States of the I/O manager.
89 */
90typedef enum PDMACEPFILEMGRSTATE
91{
92 /** Invalid state. */
93 PDMACEPFILEMGRSTATE_INVALID = 0,
94 /** Normal running state accepting new requests
95 * and processing them.
96 */
97 PDMACEPFILEMGRSTATE_RUNNING,
98 /** Fault state - not accepting new tasks for endpoints but waiting for
99 * remaining ones to finish.
100 */
101 PDMACEPFILEMGRSTATE_FAULT,
102 /** Suspending state - not accepting new tasks for endpoints but waiting
103 * for remaining ones to finish.
104 */
105 PDMACEPFILEMGRSTATE_SUSPENDING,
106 /** Shutdown state - not accepting new tasks for endpoints but waiting
107 * for remaining ones to finish.
108 */
109 PDMACEPFILEMGRSTATE_SHUTDOWN,
110 /** 32bit hack */
111 PDMACEPFILEMGRSTATE_32BIT_HACK = 0x7fffffff
112} PDMACEPFILEMGRSTATE;
113
114/**
115 * State of a async I/O manager.
116 */
117typedef struct PDMACEPFILEMGR
118{
119 /** Next Aio manager in the list. */
120 R3PTRTYPE(struct PDMACEPFILEMGR *) pNext;
121 /** Previous Aio manager in the list. */
122 R3PTRTYPE(struct PDMACEPFILEMGR *) pPrev;
123 /** Current state of the manager. */
124 PDMACEPFILEMGRSTATE enmState;
125 /** Event semaphore the manager sleeps on when waiting for new requests. */
126 RTSEMEVENT EventSem;
127 /** Flag whether the thread waits in the event semaphore. */
128 volatile bool fWaitingEventSem;
129 /** Flag whether this manager uses the failsafe method. */
130 bool fFailsafe;
131 /** Thread data */
132 RTTHREAD Thread;
133 /** The async I/O context for this manager. */
134 RTFILEAIOCTX hAioCtx;
135 /** Flag whether the I/O manager was woken up. */
136 volatile bool fWokenUp;
137 /** List of endpoints assigned to this manager. */
138 R3PTRTYPE(PPDMASYNCCOMPLETIONENDPOINTFILE) pEndpointsHead;
139 /** Number of endpoints assigned to the manager. */
140 unsigned cEndpoints;
141 /** Number of requests active currently. */
142 unsigned cRequestsActive;
143 /** Pointer to an array of free async I/O request handles. */
144 RTFILEAIOREQ *pahReqsFree;
145 /** Next free position for a free request handle. */
146 unsigned iFreeEntryNext;
147 /** Position of the next free task handle */
148 unsigned iFreeReqNext;
149 /** Size of the array. */
150 unsigned cReqEntries;
151 /** Critical section protecting the blocking event handling. */
152 RTCRITSECT CritSectBlockingEvent;
153 /** Event sempahore for blocking external events.
154 * The caller waits on it until the async I/O manager
155 * finished processing the event. */
156 RTSEMEVENT EventSemBlock;
157 /** Flag whether a blocking event is pending and needs
158 * processing by the I/O manager. */
159 volatile bool fBlockingEventPending;
160 /** Blocking event type */
161 volatile PDMACEPFILEAIOMGRBLOCKINGEVENT enmBlockingEvent;
162 /** Event type data */
163 union
164 {
165 /** Add endpoint event. */
166 struct
167 {
168 /** The endpoint to be added */
169 volatile PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint;
170 } AddEndpoint;
171 /** Remove endpoint event. */
172 struct
173 {
174 /** The endpoint to be removed */
175 volatile PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint;
176 } RemoveEndpoint;
177 /** Close endpoint event. */
178 struct
179 {
180 /** The endpoint to be closed */
181 volatile PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint;
182 } CloseEndpoint;
183 } BlockingEventData;
184} PDMACEPFILEMGR;
185/** Pointer to a async I/O manager state. */
186typedef PDMACEPFILEMGR *PPDMACEPFILEMGR;
187/** Pointer to a async I/O manager state pointer. */
188typedef PPDMACEPFILEMGR *PPPDMACEPFILEMGR;
189
190/**
191 * Data for one request segment waiting for cache entry.
192 */
193typedef struct PDMACFILETASKSEG
194{
195 /** Next task segment in the list. */
196 struct PDMACFILETASKSEG *pNext;
197 /** Task this segment is for. */
198 PPDMASYNCCOMPLETIONTASKFILE pTask;
199 /** Offset into the cache entry buffer to start reading from. */
200 uint32_t uBufOffset;
201 /** Number of bytes to transfer. */
202 size_t cbTransfer;
203 /** Pointer to the buffer. */
204 void *pvBuf;
205 /** Flag whether this entry writes data to the cache. */
206 bool fWrite;
207} PDMACFILETASKSEG, *PPDMACFILETASKSEG;
208
209/**
210 * A cache entry
211 */
212typedef struct PDMACFILECACHEENTRY
213{
214 /** The AVL entry data. */
215 AVLRFOFFNODECORE Core;
216 /** Pointer to the previous element. Used in one of the LRU lists.*/
217 struct PDMACFILECACHEENTRY *pPrev;
218 /** Pointer to the next element. Used in one of the LRU lists.*/
219 struct PDMACFILECACHEENTRY *pNext;
220 /** Pointer to the list the entry is in. */
221 PPDMACFILELRULIST pList;
222 /** Pointer to the global cache structure. */
223 PPDMACFILECACHEGLOBAL pCache;
224 /** Endpoint the entry belongs to. */
225 PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint;
226 /** Flags for this entry. Combinations of PDMACFILECACHE_* #defines */
227 uint32_t fFlags;
228 /** Reference counter. Prevents eviction of the entry if > 0. */
229 volatile uint32_t cRefs;
230 /** Size of the entry. */
231 size_t cbData;
232 /** Pointer to the memory containing the data. */
233 uint8_t *pbData;
234 /** Pointer to the buffer replacing the current one
235 * if the deprecated flag is set. */
236 uint8_t *pbDataReplace;
237 /** Head of list of tasks waiting for this one to finish. */
238 PPDMACFILETASKSEG pWaitingHead;
239 /** Tail of list of tasks waiting for this one to finish. */
240 PPDMACFILETASKSEG pWaitingTail;
241} PDMACFILECACHEENTRY, *PPDMACFILECACHEENTRY;
242/** I/O is still in progress for this entry. This entry is not evictable. */
243#define PDMACFILECACHE_ENTRY_IO_IN_PROGRESS RT_BIT(0)
244/** Entry is locked and thus not evictable. */
245#define PDMACFILECACHE_ENTRY_LOCKED RT_BIT(1)
246/** Entry is dirty */
247#define PDMACFILECACHE_ENTRY_IS_DIRTY RT_BIT(2)
248/** The current buffer used for the entry is deprecated.
249 * The new one is available and will be replaced as soon as the file update
250 * completed.
251 */
252#define PDMACFILECACHE_ENTRY_IS_DEPRECATED RT_BIT(3)
253/** Entry is not evictable. */
254#define PDMACFILECACHE_NOT_EVICTABLE (PDMACFILECACHE_ENTRY_LOCKED | PDMACFILECACHE_IO_IN_PROGRESS | PDMACFILECACHE_ENTRY_IS_DEPRECATED)
255
256/**
257 * LRU list data
258 */
259typedef struct PDMACFILELRULIST
260{
261 /** Head of the list. */
262 PPDMACFILECACHEENTRY pHead;
263 /** Tail of the list. */
264 PPDMACFILECACHEENTRY pTail;
265 /** Number of bytes cached in the list. */
266 uint32_t cbCached;
267} PDMACFILELRULIST;
268
269/**
270 * Global cache data.
271 */
272typedef struct PDMACFILECACHEGLOBAL
273{
274 /** Maximum size of the cache in bytes. */
275 uint32_t cbMax;
276 /** Current size of the cache in bytes. */
277 uint32_t cbCached;
278 /** Critical section protecting the cache. */
279 RTCRITSECT CritSect;
280#ifdef VBOX_WITH_2Q_CACHE
281 uint32_t cbRecentlyUsedInMax;
282 uint32_t cbRecentlyUsedOutMax;
283 PDMACFILELRULIST LruRecentlyUsedIn;
284 PDMACFILELRULIST LruRecentlyUsedOut;
285 PDMACFILELRULIST LruFrequentlyUsed;
286#else
287 /** Adaption parameter (p) */
288 uint32_t uAdaptVal;
289 /** LRU list for recently used entries (T1) */
290 PDMACFILELRULIST LruRecentlyUsed;
291 /** LRU list for frequently used entries (T2) */
292 PDMACFILELRULIST LruFrequentlyUsed;
293 /** LRU list for recently evicted entries (B1) */
294 PDMACFILELRULIST LruRecentlyGhost;
295 /** LRU list for evicted entries from T2 (B2) */
296 PDMACFILELRULIST LruFrequentlyGhost;
297#endif
298#ifdef VBOX_WITH_STATISTICS
299 /** Hit counter. */
300 STAMCOUNTER cHits;
301 /** Partial hit counter. */
302 STAMCOUNTER cPartialHits;
303 /** Miss counter. */
304 STAMCOUNTER cMisses;
305 /** Bytes read from cache. */
306 STAMCOUNTER StatRead;
307 /** Bytes written to the cache. */
308 STAMCOUNTER StatWritten;
309 /** Time spend to get an entry in the AVL tree. */
310 STAMPROFILEADV StatTreeGet;
311 /** Time spend to insert an entry in the AVL tree. */
312 STAMPROFILEADV StatTreeInsert;
313 /** Time spend to remove an entry in the AVL tree. */
314 STAMPROFILEADV StatTreeRemove;
315 /** Number of times a buffer could be reused. */
316 STAMCOUNTER StatBuffersReused;
317#endif
318} PDMACFILECACHEGLOBAL;
319
320/**
321 * Per endpoint cache data.
322 */
323typedef struct PDMACFILEENDPOINTCACHE
324{
325 /** AVL tree managing cache entries. */
326 PAVLRFOFFTREE pTree;
327 /** R/W semaphore protecting cached entries for this endpoint. */
328 RTSEMRW SemRWEntries;
329 /** Pointer to the gobal cache data */
330 PPDMACFILECACHEGLOBAL pCache;
331
332#ifdef VBOX_WITH_STATISTICS
333 /** Number of times a write was deferred because the cache entry was still in progress */
334 STAMCOUNTER StatWriteDeferred;
335#endif
336} PDMACFILEENDPOINTCACHE, *PPDMACFILEENDPOINTCACHE;
337
338/**
339 * Global data for the file endpoint class.
340 */
341typedef struct PDMASYNCCOMPLETIONEPCLASSFILE
342{
343 /** Common data. */
344 PDMASYNCCOMPLETIONEPCLASS Core;
345 /** Flag whether we use the failsafe method. */
346 bool fFailsafe;
347 /** Flag whether the file data cache is enabled. */
348 bool fCacheEnabled;
349 /** Flag whether the host cache should be used too. */
350 bool fHostCacheEnabled;
351 /** Critical section protecting the list of async I/O managers. */
352 RTCRITSECT CritSect;
353 /** Pointer to the head of the async I/O managers. */
354 R3PTRTYPE(PPDMACEPFILEMGR) pAioMgrHead;
355 /** Number of async I/O managers currently running. */
356 unsigned cAioMgrs;
357 /** Maximum number of segments to cache per endpoint */
358 unsigned cTasksCacheMax;
359 /** Maximum number of simultaneous outstandingrequests. */
360 uint32_t cReqsOutstandingMax;
361 /** Bitmask for checking the alignment of a buffer. */
362 RTR3UINTPTR uBitmaskAlignment;
363 /** Global cache data. */
364 PDMACFILECACHEGLOBAL Cache;
365 /** Flag whether the out of resources warning was printed already. */
366 bool fOutOfResourcesWarningPrinted;
367} PDMASYNCCOMPLETIONEPCLASSFILE;
368/** Pointer to the endpoint class data. */
369typedef PDMASYNCCOMPLETIONEPCLASSFILE *PPDMASYNCCOMPLETIONEPCLASSFILE;
370
371typedef enum PDMACEPFILEBLOCKINGEVENT
372{
373 /** The invalid event type */
374 PDMACEPFILEBLOCKINGEVENT_INVALID = 0,
375 /** A task is about to be canceled */
376 PDMACEPFILEBLOCKINGEVENT_CANCEL,
377 /** Usual 32bit hack */
378 PDMACEPFILEBLOCKINGEVENT_32BIT_HACK = 0x7fffffff
379} PDMACEPFILEBLOCKINGEVENT;
380
381/**
382 * States of the endpoint.
383 */
384typedef enum PDMASYNCCOMPLETIONENDPOINTFILESTATE
385{
386 /** Invalid state. */
387 PDMASYNCCOMPLETIONENDPOINTFILESTATE_INVALID = 0,
388 /** Normal running state accepting new requests
389 * and processing them.
390 */
391 PDMASYNCCOMPLETIONENDPOINTFILESTATE_ACTIVE,
392 /** The endpoint is about to be closed - not accepting new tasks for endpoints but waiting for
393 * remaining ones to finish.
394 */
395 PDMASYNCCOMPLETIONENDPOINTFILESTATE_CLOSING,
396 /** Removing from current I/O manager state - not processing new tasks for endpoints but waiting
397 * for remaining ones to finish.
398 */
399 PDMASYNCCOMPLETIONENDPOINTFILESTATE_REMOVING,
400 /** The current endpoint will be migrated to another I/O manager. */
401 PDMASYNCCOMPLETIONENDPOINTFILESTATE_MIGRATING,
402 /** 32bit hack */
403 PDMASYNCCOMPLETIONENDPOINTFILESTATE_32BIT_HACK = 0x7fffffff
404} PDMASYNCCOMPLETIONENDPOINTFILESTATE;
405
406/**
407 * Data for the file endpoint.
408 */
409typedef struct PDMASYNCCOMPLETIONENDPOINTFILE
410{
411 /** Common data. */
412 PDMASYNCCOMPLETIONENDPOINT Core;
413 /** Current state of the endpoint. */
414 PDMASYNCCOMPLETIONENDPOINTFILESTATE enmState;
415 /** async I/O manager this endpoint is assigned to. */
416 R3PTRTYPE(volatile PPDMACEPFILEMGR) pAioMgr;
417 /** Flags for opening the file. */
418 unsigned fFlags;
419 /** File handle. */
420 RTFILE File;
421 /** Size of the underlying file.
422 * Updated while data is appended. */
423 volatile uint64_t cbFile;
424 /** Flag whether caching is enabled for this file. */
425 bool fCaching;
426 /** Flag whether the file was opened readonly. */
427 bool fReadonly;
428 /** List of new tasks. */
429 R3PTRTYPE(volatile PPDMACTASKFILE) pTasksNewHead;
430
431 /** Head of the small cache for allocated task segments for exclusive
432 * use by this endpoint. */
433 R3PTRTYPE(volatile PPDMACTASKFILE) pTasksFreeHead;
434 /** Tail of the small cache for allocated task segments for exclusive
435 * use by this endpoint. */
436 R3PTRTYPE(volatile PPDMACTASKFILE) pTasksFreeTail;
437 /** Number of elements in the cache. */
438 volatile uint32_t cTasksCached;
439
440 /** Cache of endpoint data. */
441 PDMACFILEENDPOINTCACHE DataCache;
442
443 /** Flag whether a flush request is currently active */
444 PPDMACTASKFILE pFlushReq;
445
446 /** Event sempahore for blocking external events.
447 * The caller waits on it until the async I/O manager
448 * finished processing the event. */
449 RTSEMEVENT EventSemBlock;
450 /** Flag whether a blocking event is pending and needs
451 * processing by the I/O manager. */
452 bool fBlockingEventPending;
453 /** Blocking event type */
454 PDMACEPFILEBLOCKINGEVENT enmBlockingEvent;
455
456#ifdef VBOX_WITH_STATISTICS
457 /** Time spend in a read. */
458 STAMPROFILEADV StatRead;
459 /** Time spend in a write. */
460 STAMPROFILEADV StatWrite;
461#endif
462
463 /** Additional data needed for the event types. */
464 union
465 {
466 /** Cancelation event. */
467 struct
468 {
469 /** The task to cancel. */
470 PPDMACTASKFILE pTask;
471 } Cancel;
472 } BlockingEventData;
473 /** Data for exclusive use by the assigned async I/O manager. */
474 struct
475 {
476 /** Pointer to the next endpoint assigned to the manager. */
477 R3PTRTYPE(PPDMASYNCCOMPLETIONENDPOINTFILE) pEndpointNext;
478 /** Pointer to the previous endpoint assigned to the manager. */
479 R3PTRTYPE(PPDMASYNCCOMPLETIONENDPOINTFILE) pEndpointPrev;
480 /** List of pending requests (not submitted due to usage restrictions
481 * or a pending flush request) */
482 R3PTRTYPE(PPDMACTASKFILE) pReqsPendingHead;
483 /** Tail of pending requests. */
484 R3PTRTYPE(PPDMACTASKFILE) pReqsPendingTail;
485 /** Number of requests currently being processed for this endpoint
486 * (excluded flush requests). */
487 unsigned cRequestsActive;
488 /** Number of requests processed during the last second. */
489 unsigned cReqsPerSec;
490 /** Current number of processed requests for the current update period. */
491 unsigned cReqsProcessed;
492 /** Flag whether the endpoint is about to be moved to another manager. */
493 bool fMoving;
494 /** Destination I/O manager. */
495 PPDMACEPFILEMGR pAioMgrDst;
496 } AioMgr;
497} PDMASYNCCOMPLETIONENDPOINTFILE;
498/** Pointer to the endpoint class data. */
499typedef PDMASYNCCOMPLETIONENDPOINTFILE *PPDMASYNCCOMPLETIONENDPOINTFILE;
500
501/** Request completion function */
502typedef DECLCALLBACK(void) FNPDMACTASKCOMPLETED(PPDMACTASKFILE pTask, void *pvUser);
503/** Pointer to a request completion function. */
504typedef FNPDMACTASKCOMPLETED *PFNPDMACTASKCOMPLETED;
505
506/**
507 * Transfer type.
508 */
509typedef enum PDMACTASKFILETRANSFER
510{
511 /** Invalid. */
512 PDMACTASKFILETRANSFER_INVALID = 0,
513 /** Read transfer. */
514 PDMACTASKFILETRANSFER_READ,
515 /** Write transfer. */
516 PDMACTASKFILETRANSFER_WRITE,
517 /** Flush transfer. */
518 PDMACTASKFILETRANSFER_FLUSH
519} PDMACTASKFILETRANSFER;
520
521/**
522 * Data of a request.
523 */
524typedef struct PDMACTASKFILE
525{
526 /** next task in the list. */
527 struct PDMACTASKFILE *pNext;
528 /** Endpoint */
529 PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint;
530 /** Transfer type. */
531 PDMACTASKFILETRANSFER enmTransferType;
532 /** Start offset */
533 RTFOFF Off;
534 /** Data segment. */
535 PDMDATASEG DataSeg;
536 /** Flag whether this segment uses a bounce buffer
537 * because the provided buffer doesn't meet host requirements. */
538 bool fBounceBuffer;
539 /** Pointer to the used bounce buffer if any. */
540 void *pvBounceBuffer;
541 /** Start offset in the bounce buffer to copy from. */
542 uint32_t uBounceBufOffset;
543 /** Flag whether this is a prefetch request. */
544 bool fPrefetch;
545 /** Completion function to call on completion. */
546 PFNPDMACTASKCOMPLETED pfnCompleted;
547 /** User data */
548 void *pvUser;
549} PDMACTASKFILE;
550
551/**
552 * Per task data.
553 */
554typedef struct PDMASYNCCOMPLETIONTASKFILE
555{
556 /** Common data. */
557 PDMASYNCCOMPLETIONTASK Core;
558 /** Number of bytes to transfer until this task completes. */
559 volatile int32_t cbTransferLeft;
560 /** Flag whether the task completed. */
561 volatile bool fCompleted;
562} PDMASYNCCOMPLETIONTASKFILE;
563
564int pdmacFileAioMgrFailsafe(RTTHREAD ThreadSelf, void *pvUser);
565int pdmacFileAioMgrNormal(RTTHREAD ThreadSelf, void *pvUser);
566
567int pdmacFileAioMgrNormalInit(PPDMACEPFILEMGR pAioMgr);
568void pdmacFileAioMgrNormalDestroy(PPDMACEPFILEMGR pAioMgr);
569
570int pdmacFileAioMgrCreate(PPDMASYNCCOMPLETIONEPCLASSFILE pEpClass, PPPDMACEPFILEMGR ppAioMgr, bool fFailsafe);
571
572int pdmacFileAioMgrAddEndpoint(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint);
573
574PPDMACTASKFILE pdmacFileEpGetNewTasks(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint);
575PPDMACTASKFILE pdmacFileTaskAlloc(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint);
576void pdmacFileTaskFree(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint,
577 PPDMACTASKFILE pTask);
578
579int pdmacFileEpAddTask(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMACTASKFILE pTask);
580
581void pdmacFileEpTaskCompleted(PPDMACTASKFILE pTask, void *pvUser);
582
583int pdmacFileCacheInit(PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile, PCFGMNODE pCfgNode);
584void pdmacFileCacheDestroy(PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile);
585int pdmacFileEpCacheInit(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile);
586void pdmacFileEpCacheDestroy(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint);
587
588int pdmacFileEpCacheRead(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMASYNCCOMPLETIONTASKFILE pTask,
589 RTFOFF off, PCPDMDATASEG paSegments, size_t cSegments,
590 size_t cbRead);
591int pdmacFileEpCacheWrite(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMASYNCCOMPLETIONTASKFILE pTask,
592 RTFOFF off, PCPDMDATASEG paSegments, size_t cSegments,
593 size_t cbWrite);
594
595RT_C_DECLS_END
596
597#endif
598
Note: See TracBrowser for help on using the repository browser.

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