Enhanced Unix code for auto-extending files.
git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@653 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
@@ -2754,6 +2754,7 @@ void F_FileHdl::initCommonData( void)
|
||||
m_bOpenedExclusive = FALSE;
|
||||
m_bOpenedInAsyncMode = FALSE;
|
||||
m_bDoDirectIO = FALSE;
|
||||
m_numAsyncPending = 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -2761,6 +2762,8 @@ Desc:
|
||||
******************************************************************************/
|
||||
void F_FileHdl::freeCommonData( void)
|
||||
{
|
||||
f_assert( !m_numAsyncPending);
|
||||
|
||||
if( m_pucAlignedBuff)
|
||||
{
|
||||
f_freeAlignedBuffer( (void **)&m_pucAlignedBuff);
|
||||
@@ -3033,6 +3036,8 @@ RCODE F_FileAsyncClient::prepareForAsync(
|
||||
m_pIOBuffer->setPending();
|
||||
}
|
||||
|
||||
f_atomicInc( &m_pFileHdl->m_numAsyncPending);
|
||||
|
||||
Exit:
|
||||
|
||||
return( rc);
|
||||
@@ -3141,6 +3146,8 @@ void FLMAPI F_FileAsyncClient::notifyComplete(
|
||||
|
||||
if( m_pFileHdl)
|
||||
{
|
||||
f_assert( m_pFileHdl->m_numAsyncPending);
|
||||
f_atomicDec( &m_pFileHdl->m_numAsyncPending);
|
||||
m_pFileHdl->Release();
|
||||
m_pFileHdl = NULL;
|
||||
}
|
||||
@@ -3268,6 +3275,10 @@ RCODE F_FileHdl::directRead(
|
||||
{
|
||||
ui64ReadOffset = m_ui64CurrentPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui64CurrentPos = ui64ReadOffset;
|
||||
}
|
||||
|
||||
// This loop does multiple reads (if necessary) to get all of the
|
||||
// data. It uses aligned buffers and reads at sector offsets.
|
||||
@@ -3423,6 +3434,10 @@ RCODE F_FileHdl::directWrite(
|
||||
{
|
||||
ui64WriteOffset = m_ui64CurrentPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui64CurrentPos = ui64WriteOffset;
|
||||
}
|
||||
|
||||
if( pIOBuffer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user