ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

BOOLEAN NTAPI Ext2AcqReadAhead ( IN PVOID  Context,
IN BOOLEAN  Wait 
)

Definition at line 1001 of file fastio.c.

Referenced by Ext2FsdInitializeFunctionPointers().

{

    BOOLEAN             ReturnedStatus = TRUE;

    PtrExt2FCB          PtrFCB = NULL;
    PtrExt2CCB          PtrCCB = NULL;
    PtrExt2NTRequiredFCB    PtrReqdFCB = NULL;

    // The context is whatever we passed to the Cache Manager when invoking
    // the CcInitializeCacheMaps() function. In the case of the sample FSD
    // implementation, this context is a pointer to the CCB structure.
    
    ASSERT(Context);
    PtrCCB = (PtrExt2CCB)(Context);
    ASSERT(PtrCCB->NodeIdentifier.NodeType == EXT2_NODE_TYPE_CCB);

    DebugTrace(DEBUG_TRACE_IRP_ENTRY,"~~~[FastIO call]~~~  Ext2AcqReadAhead", 0);
    if( PtrCCB && PtrCCB->PtrFileObject )
    {
        DebugTrace(DEBUG_TRACE_FILE_OBJ, "###### File Pointer 0x%LX [FastIO]", PtrCCB->PtrFileObject );
    }

    PtrFCB = PtrCCB->PtrFCB;
    ASSERT(PtrFCB);

    AssertFCB( PtrFCB );
/*
    if( PtrFCB->NodeIdentifier.NodeType != EXT2_NODE_TYPE_FCB )
    {
        //  Ext2BreakPoint();
        DebugTrace(DEBUG_TRACE_ERROR,   "~~~[FastIO call]~~~  Invalid FCB...", 0);
        return TRUE;
    }   */

    PtrReqdFCB = &(PtrFCB->NTRequiredFCB);

    // Acquire the MainResource in the FCB shared.
    // Note: The read-ahead thread typically always supplies WAIT set to TRUE.
    DebugTrace(DEBUG_TRACE_MISC,"*** Attempting to acquire FCB Shared [FastIo]", 0);

    DebugTraceState( "FCBMain   AC:0x%LX   SW:0x%LX   EX:0x%LX   [FastIo]", PtrReqdFCB->MainResource.ActiveCount, PtrReqdFCB->MainResource.NumberOfExclusiveWaiters, PtrReqdFCB->MainResource.NumberOfSharedWaiters );
    if (!ExAcquireResourceSharedLite(&(PtrReqdFCB->MainResource), Wait)) 
    {
        DebugTrace(DEBUG_TRACE_MISC,"*** Attempt to acquire FCB FAILED [FastIo]", 0);
        ReturnedStatus = FALSE;
    }
    else
    {
        DebugTrace(DEBUG_TRACE_MISC,"***  FCB acquired [FastIo]", 0);
    }

    // If your FSD needs to perform some special preparations in anticipation
    // of receving a read-ahead request, do so now.

    return ReturnedStatus;
    
}

Generated on Sat May 26 2012 05:22:35 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.