VirtualBox

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

最後變更 在這個檔案從24517是 24517,由 vboxsync 提交於 15 年 前

AsyncCompletion: Reuse evicted buffers if possible to avoid too much free/allocation calls

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

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