8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 14:03:07 +01:00
This commit is contained in:
asfernandes 2007-09-19 01:46:45 +00:00
parent d792faaf49
commit 96a6ad5863
4 changed files with 17 additions and 11 deletions

View File

@ -4612,4 +4612,3 @@ static processing_state show_users()
return rc;
}

View File

@ -559,7 +559,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
if (write_pages > leftPages)
write_pages = leftPages;
SLONG to_write = write_pages * dbb->dbb_page_size, written;
SLONG to_write = write_pages * dbb->dbb_page_size;
SLONG written;
{
for (int r = 0; r < IO_RETRY; r++)
@ -586,6 +587,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
leftPages -= write_pages;
i += write_pages;
}
return (initPages - leftPages);
***/
}
@ -1311,4 +1313,3 @@ static int raw_devices_unlink_database (
return 0;
}
#endif // SUPPORT_RAW_DEVICES

View File

@ -364,7 +364,7 @@ void PIO_extend(jrd_file* main_file, const ULONG extPages, const USHORT pageSize
LARGE_INTEGER newSize;
newSize.QuadPart = (ULONGLONG) (filePages + extendBy) * pageSize;
if (ostype == OS_CHICAGO) {
if (ostype == OS_CHICAGO) { // WIN95
file->fil_mutex.enter();
}
@ -385,6 +385,7 @@ void PIO_extend(jrd_file* main_file, const ULONG extPages, const USHORT pageSize
if (ostype == OS_CHICAGO) {
file->fil_mutex.leave();
}
leftPages -= extendBy;
}
}
@ -608,7 +609,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
bdb.bdb_dbb = dbb;
bdb.bdb_page = PageNumber(0, startPage);
OVERLAPPED overlapped, *overlapped_ptr;
OVERLAPPED overlapped;
OVERLAPPED* overlapped_ptr;
jrd_file* file =
seek_file(main_file, &bdb, status_vector, &overlapped, &overlapped_ptr);
@ -632,7 +634,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
seek_file(main_file, &bdb, status_vector, &overlapped, &overlapped_ptr);
DWORD to_write = (DWORD) write_pages * dbb->dbb_page_size, written;
DWORD to_write = (DWORD) write_pages * dbb->dbb_page_size;
DWORD written;
if (!WriteFile(file->fil_desc, zero_buff, to_write, &written, overlapped_ptr) ||
to_write != written)
@ -650,6 +653,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
leftPages -= write_pages;
i += write_pages;
}
return (initPages - leftPages);
}
@ -1351,4 +1355,3 @@ static bool nt_error(TEXT* string,
return true;
}

View File

@ -851,6 +851,7 @@ PAG PAG_allocate(WIN * window)
}
fb_assert(new_page);
}
if (!(dbb->dbb_flags & DBB_no_reserve))
{
const ULONG initialized =
@ -858,7 +859,7 @@ PAG PAG_allocate(WIN * window)
// At this point we ensure database has at least "initialized" pages
// allocated. To avoid file growth by few pages when all this space
// will be used extend file up to initialized + next_init_pages now
// will be used, extend file up to initialized + next_init_pages now
pageSpace->extend(tdbb, initialized + next_init_pages);
}
}
@ -2420,11 +2421,13 @@ void PageManager::closeAll()
void PageManager::releaseLocks()
{
for (size_t i = 0; i < pageSpaces.getCount(); i++)
{
if (pageSpaces[i]->file && pageSpaces[i]->file->fil_ext_lock) {
delete pageSpaces[i]->file->fil_ext_lock;
pageSpaces[i]->file->fil_ext_lock = NULL;
}
}
}
USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
{