Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

logrcsup.c File Reference

#include "lfsprocs.h"

Go to the source code of this file.

Defines

#define Dbg   (DEBUG_TRACE_LOG_RECORD_SUP)

Functions

VOID LfsPrepareLfcbForLogRecord (IN OUT PLFCB Lfcb, IN ULONG RemainingLogBytes)
VOID LfsTransferLogBytes (IN PLBCB Lbcb, IN OUT PLFS_WRITE_ENTRY *ThisWriteEntry, IN OUT PCHAR *CurrentBuffer, IN OUT PULONG CurrentByteCount, IN OUT PULONG PadBytes, IN OUT PULONG RemainingPageBytes, IN OUT PULONG RemainingLogBytes)
BOOLEAN LfsWriteLogRecordIntoLogPage (IN PLFCB Lfcb, IN PLCH Lch, IN ULONG NumberOfWriteEntries, IN PLFS_WRITE_ENTRY WriteEntries, IN LFS_RECORD_TYPE RecordType, IN TRANSACTION_ID *TransactionId OPTIONAL, IN LSN ClientUndoNextLsn OPTIONAL, IN LSN ClientPreviousLsn OPTIONAL, IN LONG UndoRequirement, IN BOOLEAN ForceToDisk, OUT PLSN Lsn)


Define Documentation

#define Dbg   (DEBUG_TRACE_LOG_RECORD_SUP)
 

Definition at line 28 of file logrcsup.c.


Function Documentation

VOID LfsPrepareLfcbForLogRecord IN OUT PLFCB  Lfcb,
IN ULONG  RemainingLogBytes
 

Definition at line 431 of file logrcsup.c.

References _LBCB::ActiveLinks, _LBCB::BufferOffset, ClearFlag, Dbg, DebugTrace, FlagOn, LBCB_ON_ACTIVE_QUEUE, _LBCB::LbcbFlags, LFCB_PACK_LOG, LfsGetLbcb(), PAGED_CODE, and TRUE.

Referenced by LfsWriteLogRecordIntoLogPage().

00438 : 00439 00440 This routine is called to insure that the Lfcb has a Lbcb in the 00441 active queue to perform the next log record transfer. 00442 This condition is met when there is a least one buffer block and 00443 the log record data will fit entirely on this page or this buffer 00444 block contains no other data in the unpacked case. For the packed 00445 case we just need to make sure that there are sufficient Lbcb's. 00446 00447 Arguments: 00448 00449 Lfcb - File control block for this log file. 00450 00451 RemainingLogBytes - The number of bytes remaining for this log record. 00452 00453 Return Value: 00454 00455 None 00456 00457 --*/ 00458 00459 { 00460 PLBCB ThisLbcb; 00461 ULONG RemainingPageBytes; 00462 PLIST_ENTRY LbcbLinks; 00463 00464 PAGED_CODE(); 00465 00466 DebugTrace( +1, Dbg, "LfsPrepareLfcbForLogRecord: Entered\n", 0 ); 00467 DebugTrace( 0, Dbg, "Lfcb -> %08lx\n", Lfcb ); 00468 DebugTrace( 0, Dbg, "RemainingLogBytes -> %08lx\n", RemainingLogBytes ); 00469 00470 // 00471 // If there is no Lbcb in the active queue, we don't check it for size. 00472 // 00473 00474 if (!IsListEmpty( &Lfcb->LbcbActive )) { 00475 00476 // 00477 // If the log record won't fit in the remaining bytes of this page, 00478 // we queue this log buffer. 00479 // 00480 00481 ThisLbcb = CONTAINING_RECORD( Lfcb->LbcbActive.Flink, 00482 LBCB, 00483 ActiveLinks ); 00484 00485 RemainingPageBytes = (ULONG)Lfcb->LogPageSize 00486 - (ULONG)ThisLbcb->BufferOffset; 00487 00488 // 00489 // This log page won't do if the remaining bytes won't hold the data 00490 // unless this is the first log record in the page or we are packing 00491 // the log file. 00492 // 00493 00494 if (RemainingLogBytes > RemainingPageBytes 00495 && !FlagOn( Lfcb->Flags, LFCB_PACK_LOG ) 00496 && (ULONG)ThisLbcb->BufferOffset != (ULONG)Lfcb->LogPageDataOffset) { 00497 00498 RemoveHeadList( &Lfcb->LbcbActive ); 00499 ClearFlag( ThisLbcb->LbcbFlags, LBCB_ON_ACTIVE_QUEUE ); 00500 } 00501 } 00502 00503 // 00504 // We now make sure we can allocate enough Lbcb's for all of the log pages 00505 // we will need. We now include the bytes for the log record reader. 00506 // 00507 00508 LbcbLinks = Lfcb->LbcbActive.Flink; 00509 00510 while (TRUE) { 00511 00512 // 00513 // If the Lbcb link we have is the head of the list, we will need another 00514 // Lbcb. 00515 // 00516 00517 if (LbcbLinks == &Lfcb->LbcbActive) { 00518 00519 ThisLbcb = LfsGetLbcb( Lfcb ); 00520 00521 } else { 00522 00523 ThisLbcb = CONTAINING_RECORD( LbcbLinks, 00524 LBCB, 00525 ActiveLinks ); 00526 } 00527 00528 // 00529 // Remember the bytes remaining on this page. This will always be quad 00530 // aligned. 00531 // 00532 00533 RemainingPageBytes = (ULONG)Lfcb->LogPageSize - (ULONG)ThisLbcb->BufferOffset; 00534 00535 if (RemainingPageBytes >= RemainingLogBytes) { 00536 00537 break; 00538 } 00539 00540 // 00541 // Move to the next log record. 00542 // 00543 00544 RemainingLogBytes -= RemainingPageBytes; 00545 00546 LbcbLinks = ThisLbcb->ActiveLinks.Flink; 00547 } 00548 00549 DebugTrace( -1, Dbg, "LfsPrepareLfcbForLogRecord: Exit\n", 0 ); 00550 00551 return; 00552 }

VOID LfsTransferLogBytes IN PLBCB  Lbcb,
IN OUT PLFS_WRITE_ENTRY ThisWriteEntry,
IN OUT PCHAR *  CurrentBuffer,
IN OUT PULONG  CurrentByteCount,
IN OUT PULONG  PadBytes,
IN OUT PULONG  RemainingPageBytes,
IN OUT PULONG  RemainingLogBytes
 

Definition at line 556 of file logrcsup.c.

References Add2Ptr, Dbg, DebugTrace, NULL, and PAGED_CODE.

Referenced by LfsWriteLogRecordIntoLogPage().

00568 : 00569 00570 This routine is called to transfer the next block of bytes into 00571 a log page. It is given a pointer to the current position in the 00572 current Lfs write entry and the number of bytes remaining on that 00573 log page. It will transfer as many of the client's bytes from the 00574 current buffer that will fit and update various pointers. 00575 00576 Arguments: 00577 00578 Lbcb - This is the buffer block for this log page. 00579 00580 ThisWriteEntry - This is a pointer to a pointer to the current Lfs 00581 write entry. 00582 00583 CurrentBuffer - This is a pointer to a pointer to the current position 00584 in the current write entry buffer. If this points to a NULL 00585 value it means to put zero bytes into the log. 00586 00587 CurrentByteCount - This is a pointer to the number of bytes remaining 00588 in the current buffer. 00589 00590 PadBytes - This is a pointer to the number of padding byes for 00591 this write entry. 00592 00593 RemainingPageBytes - This is pointer to the number of bytes remaining 00594 in this page. 00595 00596 RemainingLogBytes - This is the number of bytes remaining to transfer 00597 for this log record. 00598 00599 Return Value: 00600 00601 None 00602 00603 --*/ 00604 00605 { 00606 PCHAR CurrentLogPagePosition; 00607 PCHAR CurrentClientPosition; 00608 00609 ULONG TransferBytes; 00610 ULONG ThisPadBytes; 00611 00612 PAGED_CODE(); 00613 00614 DebugTrace( +1, Dbg, "LfsTransferLogBytes: Entered\n", 0 ); 00615 DebugTrace( 0, Dbg, "Lbcb -> %08lx\n", Lbcb ); 00616 DebugTrace( 0, Dbg, "ThisWriteEntry -> %08lx\n", *ThisWriteEntry ); 00617 DebugTrace( 0, Dbg, "CurrentBuffer -> %08lx\n", *CurrentBuffer ); 00618 DebugTrace( 0, Dbg, "CurrentByteCount -> %08lx\n", *CurrentByteCount ); 00619 DebugTrace( 0, Dbg, "RemainingPageBytes -> %08lx\n", *RemainingPageBytes ); 00620 DebugTrace( 0, Dbg, "RemainingLogBytes -> %08lx\n", *RemainingLogBytes ); 00621 00622 // 00623 // Remember the current client buffer position and current position 00624 // in log page. 00625 // 00626 00627 CurrentLogPagePosition = Add2Ptr( Lbcb->PageHeader, (ULONG)Lbcb->BufferOffset, PCHAR ); 00628 CurrentClientPosition = *CurrentBuffer; 00629 00630 // 00631 // The limiting factor is either the number of bytes remaining in a 00632 // write entry or the number remaining in the log page. 00633 // 00634 00635 if (*CurrentByteCount <= *RemainingPageBytes) { 00636 00637 TransferBytes = *CurrentByteCount; 00638 00639 ThisPadBytes = *PadBytes; 00640 00641 if (*RemainingLogBytes != (*CurrentByteCount + *PadBytes) ) { 00642 00643 (*ThisWriteEntry)++; 00644 00645 *CurrentBuffer = (*ThisWriteEntry)->Buffer; 00646 *CurrentByteCount = (*ThisWriteEntry)->ByteLength; 00647 00648 *PadBytes = (8 - (*CurrentByteCount & ~(0xfffffff8))) & ~(0xfffffff8); 00649 } 00650 00651 } else { 00652 00653 TransferBytes = *RemainingPageBytes; 00654 00655 ThisPadBytes = 0; 00656 00657 *CurrentByteCount -= TransferBytes; 00658 00659 if (*CurrentBuffer != NULL) { 00660 00661 *CurrentBuffer += TransferBytes; 00662 } 00663 } 00664 00665 // 00666 // Transfer the requested bytes. 00667 // 00668 00669 if (CurrentClientPosition != NULL) { 00670 00671 RtlCopyMemory( CurrentLogPagePosition, CurrentClientPosition, TransferBytes ); 00672 00673 } else { 00674 00675 RtlZeroMemory( CurrentLogPagePosition, TransferBytes ); 00676 } 00677 00678 // 00679 // Reduce the remaining page and log bytes by the transfer amount and 00680 // move forward in the log page. 00681 // 00682 00683 *RemainingLogBytes -= (TransferBytes + ThisPadBytes); 00684 *RemainingPageBytes -= (TransferBytes + ThisPadBytes); 00685 00686 (ULONG)Lbcb->BufferOffset += (TransferBytes + ThisPadBytes); 00687 00688 DebugTrace( -1, Dbg, "LfsTransferLogBytes: Exit\n", 0 ); 00689 00690 return; 00691 } }

BOOLEAN LfsWriteLogRecordIntoLogPage IN PLFCB  Lfcb,
IN PLCH  Lch,
IN ULONG  NumberOfWriteEntries,
IN PLFS_WRITE_ENTRY  WriteEntries,
IN LFS_RECORD_TYPE  RecordType,
IN TRANSACTION_ID *TransactionId  OPTIONAL,
IN LSN ClientUndoNextLsn  OPTIONAL,
IN LSN ClientPreviousLsn  OPTIONAL,
IN LONG  UndoRequirement,
IN BOOLEAN  ForceToDisk,
OUT PLSN  Lsn
 

Definition at line 55 of file logrcsup.c.

References Add2Ptr, _LFS_WRITE_ENTRY::Buffer, _LBCB::BufferOffset, _LFS_WRITE_ENTRY::ByteLength, ClearFlag, _LFS_RECORD_HEADER::ClientDataLength, _LFS_RECORD_HEADER::ClientId, _LFS_RECORD_HEADER::ClientPreviousLsn, _LFS_RECORD_HEADER::ClientUndoNextLsn, _LFS_RECORD_PAGE_HEADER::Copy, Dbg, DebugTrace, Executive, FALSE, FlagOn, _LFS_RECORD_PAGE_HEADER::Flags, _LBCB::Flags, _LFS_RECORD_HEADER::Flags, _LFS_RECORD_PAGE_HEADER::Header, KernelMode, KeWaitForSingleObject(), _LBCB::LastEndLsn, _LBCB::LastLsn, LBCB_NOT_EMPTY, LBCB_ON_ACTIVE_QUEUE, _LBCB::LbcbFlags, LFCB_NO_LAST_LSN, LFCB_PACK_LOG, LfsAcquireLfcb, LfsComputeLsnFromLbcb, LfsPrepareLfcbForLogRecord(), LfsReleaseLfcb, LfsTransferLogBytes(), LfsVerifyLogSpaceAvail(), LOG_PAGE_LOG_RECORD_END, LOG_RECORD_MULTI_PAGE, _LBCB::LogPageBcb, LSN, NULL, PAGED_CODE, _LBCB::PageHeader, QuadAlign, _LFS_RECORD_HEADER::RecordType, SetFlag, _LFS_RECORD_HEADER::ThisLsn, _LFS_RECORD_HEADER::TransactionId, TRUE, USHORT, and _LBCB::WorkqueLinks.

Referenced by LfsForceWrite(), LfsWrite(), and LfsWriteRestartArea().

00071 : 00072 00073 This routine is called to write a log record into the log file 00074 using the cache manager. If there is room in the current log 00075 page it is added to that. Otherwise we allocate a new log page 00076 and write the log record header for this log page. We then 00077 write the log record into the remaining bytes of this page and 00078 into any subsequent pages if needed. 00079 00080 Arguments: 00081 00082 Lfcb - File control block for this log file. 00083 00084 Lch - This is the client handle, we may update the undo space for this 00085 client. 00086 00087 NumberOfWriteEntries - Number of components of the log record. 00088 00089 WriteEntries - Pointer to an array of write entries. 00090 00091 UndoRequirement - Signed value indicating the requirement to write 00092 an abort log record for this log record. A negative 00093 value indicates that this is the abort record. 00094 00095 RecordType - The Lfs-defined type of this log record. 00096 00097 TransactionId - Pointer to the transaction structure containing the 00098 Id for transaction containing this operation. 00099 00100 ClientUndoNextLsn - This is the Lsn provided by the client for use 00101 in his restart. Will be the zero Lsn for 00102 a restart log record. 00103 00104 ClientPreviousLsn - This is the Lsn provided by the client for use 00105 in his restart. Will the the zero Lsn for a 00106 restart log record. 00107 00108 UndoRequirement - This is the data size for the undo record for 00109 this log record. 00110 00111 ForceToDisk - Indicates if this log record will be flushed immediately 00112 to disk. 00113 00114 Lsn - A pointer to store the Lsn for this log record. 00115 00116 Return Value: 00117 00118 BOOLEAN - Advisory, TRUE indicates that less than 1/4 of the log file is 00119 available. 00120 00121 --*/ 00122 00123 { 00124 PLFS_WRITE_ENTRY ThisWriteEntry; 00125 00126 ULONG RemainingLogBytes; 00127 ULONG OriginalLogBytes; 00128 00129 ULONG RemainingPageBytes; 00130 ULONG HeaderAdjust; 00131 00132 PLBCB ThisLbcb; 00133 00134 LSN NextLsn; 00135 00136 PLFS_RECORD_HEADER RecordHeader; 00137 00138 PCHAR CurrentBuffer; 00139 ULONG CurrentByteCount; 00140 ULONG PadBytes; 00141 00142 BOOLEAN LogFileFull = FALSE; 00143 00144 PAGED_CODE(); 00145 00146 DebugTrace( +1, Dbg, "LfsWriteLogRecordIntoLogPage: Entered\n", 0 ); 00147 DebugTrace( 0, Dbg, "Lfcb -> %08lx\n", Lfcb ); 00148 DebugTrace( 0, Dbg, "Lch -> %08lx\n", Lch ); 00149 DebugTrace( 0, Dbg, "Number of Write Entries -> %08lx\n", NumberOfWriteEntries ); 00150 DebugTrace( 0, Dbg, "Write Entries -> %08lx\n", WriteEntries ); 00151 DebugTrace( 0, Dbg, "Record Type -> %08lx\n", RecordType ); 00152 DebugTrace( 0, Dbg, "Transaction Id -> %08lx\n", TransactionId ); 00153 DebugTrace( 0, Dbg, "ClientUndoNextLsn (Low) -> %08lx\n", ClientUndoNextLsn.LowPart ); 00154 DebugTrace( 0, Dbg, "ClientUndoNextLsn (High) -> %08lx\n", ClientUndoNextLsn.HighPart ); 00155 DebugTrace( 0, Dbg, "ClientPreviousLsn (Low) -> %08lx\n", ClientPreviousLsn.LowPart ); 00156 DebugTrace( 0, Dbg, "ClientPreviousLsn (High) -> %08lx\n", ClientPreviousLsn.HighPart ); 00157 DebugTrace( 0, Dbg, "UndoRequirement -> %08lx\n", UndoRequirement ); 00158 DebugTrace( 0, Dbg, "ForceToDisk -> %04x\n", ForceToDisk ); 00159 00160 // 00161 // We compute the size of this log record. 00162 // 00163 00164 ThisWriteEntry = WriteEntries; 00165 00166 RemainingLogBytes = 0; 00167 00168 while (NumberOfWriteEntries--) { 00169 00170 RemainingLogBytes += QuadAlign( ThisWriteEntry->ByteLength ); 00171 00172 ThisWriteEntry++; 00173 } 00174 00175 OriginalLogBytes = RemainingLogBytes; 00176 00177 ThisWriteEntry = WriteEntries; 00178 00179 // 00180 // Loop until we have the Lbcb and we know it is not part of 00181 // a partial page transfer. We need to make sure we have 00182 // a Bcb for this page. 00183 // 00184 00185 while (TRUE) { 00186 00187 LogFileFull = LfsVerifyLogSpaceAvail( Lfcb, 00188 Lch, 00189 RemainingLogBytes, 00190 UndoRequirement, 00191 ForceToDisk ); 00192 00193 // 00194 // We update the Lfcb so that we can start putting the log record into 00195 // the top of the Lbcb active list. 00196 // 00197 00198 LfsPrepareLfcbForLogRecord( Lfcb, 00199 RemainingLogBytes + Lfcb->RecordHeaderLength ); 00200 00201 ThisLbcb = CONTAINING_RECORD( Lfcb->LbcbActive.Flink, 00202 LBCB, 00203 ActiveLinks ); 00204 00205 // 00206 // If there is a Bcb then we are golden. 00207 // 00208 00209 if (ThisLbcb->LogPageBcb != NULL) { break; } 00210 00211 // 00212 // Otherwise we want to drop the Lfcb and wait for the IO to complete. 00213 // 00214 00215 Lfcb->Waiters += 1; 00216 00217 LfsReleaseLfcb( Lfcb ); 00218 00219 KeWaitForSingleObject( &Lfcb->Sync->Event, 00220 Executive, 00221 KernelMode, 00222 FALSE, 00223 NULL ); 00224 00225 LfsAcquireLfcb( Lfcb ); 00226 Lfcb->Waiters -= 1; 00227 } 00228 00229 RemainingPageBytes = (ULONG)Lfcb->LogPageSize - (ULONG)ThisLbcb->BufferOffset; 00230 00231 // 00232 // Compute the Lsn starting in the next log buffer. 00233 // 00234 00235 NextLsn.QuadPart = LfsComputeLsnFromLbcb( Lfcb, ThisLbcb ); 00236 00237 // 00238 // We get a pointer to the log record header and the start of the 00239 // log record in the pinned buffer. 00240 // 00241 00242 RecordHeader = Add2Ptr( ThisLbcb->PageHeader, 00243 (ULONG)ThisLbcb->BufferOffset, 00244 PLFS_RECORD_HEADER ); 00245 00246 // 00247 // We update the record header. 00248 // 00249 00250 // 00251 // Zero out the structure initially. 00252 // 00253 00254 RtlZeroMemory( RecordHeader, Lfcb->RecordHeaderLength ); 00255 00256 // 00257 // Update all the fields. 00258 // 00259 00260 RecordHeader->ThisLsn = NextLsn; 00261 RecordHeader->ClientPreviousLsn = ClientPreviousLsn; 00262 RecordHeader->ClientUndoNextLsn = ClientUndoNextLsn; 00263 00264 if (TransactionId != NULL) { 00265 RecordHeader->TransactionId = *TransactionId; 00266 } 00267 00268 RecordHeader->ClientDataLength = RemainingLogBytes; 00269 RecordHeader->ClientId = Lch->ClientId; 00270 RecordHeader->RecordType = RecordType; 00271 00272 // 00273 // Check if this is a multi-page record. 00274 // 00275 00276 if (RemainingLogBytes + Lfcb->RecordHeaderLength > RemainingPageBytes) { 00277 00278 SetFlag( RecordHeader->Flags, LOG_RECORD_MULTI_PAGE ); 00279 } 00280 00281 RemainingPageBytes -= Lfcb->RecordHeaderLength; 00282 00283 // 00284 // Update the buffer position in the Lbcb 00285 // 00286 00287 (ULONG)ThisLbcb->BufferOffset += Lfcb->RecordHeaderLength; 00288 HeaderAdjust = Lfcb->RecordHeaderLength; 00289 00290 // 00291 // Remember the values in the current write entry. 00292 // 00293 00294 CurrentBuffer = ThisWriteEntry->Buffer; 00295 CurrentByteCount = ThisWriteEntry->ByteLength; 00296 00297 PadBytes = (8 - (CurrentByteCount & ~(0xfffffff8))) & ~(0xfffffff8); 00298 00299 // 00300 // Continue to transfer bytes until all the client's data has 00301 // been transferred. 00302 // 00303 00304 while (RemainingLogBytes != 0) { 00305 00306 PLFS_RECORD_PAGE_HEADER PageHeader; 00307 00308 PageHeader = (PLFS_RECORD_PAGE_HEADER) ThisLbcb->PageHeader; 00309 00310 // 00311 // If the Lbcb is empty and we are about to store data into it we 00312 // subtract the data size of the page from the available space. 00313 // Update all the information we want to put in the header. 00314 // 00315 00316 if (!FlagOn( ThisLbcb->LbcbFlags, LBCB_NOT_EMPTY )) { 00317 00318 // 00319 // We subtract this page from the available pages only if 00320 // we are at the beginning of the page. Otherwise this 00321 // could be a reuse page. In that case it has already 00322 // been subtracted. 00323 // 00324 00325 if ((ULONG)ThisLbcb->BufferOffset - HeaderAdjust == (ULONG)Lfcb->LogPageDataOffset) { 00326 00327 00328 Lfcb->CurrentAvailable = Lfcb->CurrentAvailable - Lfcb->ReservedLogPageSize; //**** xxSub( Lfcb->CurrentAvailable, Lfcb->ReservedLogPageSize ); 00329 } 00330 00331 InsertTailList( &Lfcb->LbcbWorkque, &ThisLbcb->WorkqueLinks ); 00332 SetFlag( ThisLbcb->LbcbFlags, LBCB_NOT_EMPTY ); 00333 } 00334 00335 HeaderAdjust = 0; 00336 00337 // 00338 // Compute the number of transfer bytes. Update the remaining 00339 // page bytes, remaining log bytes and position in the write 00340 // buffer array. This routine also copies the bytes into the buffer. 00341 // 00342 00343 LfsTransferLogBytes( ThisLbcb, 00344 &ThisWriteEntry, 00345 &CurrentBuffer, 00346 &CurrentByteCount, 00347 &PadBytes, 00348 &RemainingPageBytes, 00349 &RemainingLogBytes ); 00350 00351 // 00352 // This log record ends on this page. Update the fields for the 00353 // ending Lsn. 00354 // 00355 00356 if (RemainingLogBytes == 0) { 00357 00358 SetFlag( ThisLbcb->Flags, LOG_PAGE_LOG_RECORD_END ); 00359 ThisLbcb->LastEndLsn = NextLsn; 00360 00361 if (FlagOn( Lfcb->Flags, LFCB_PACK_LOG )) { 00362 00363 PageHeader->Header.Packed.LastEndLsn = NextLsn; 00364 PageHeader->Header.Packed.NextRecordOffset = (USHORT)ThisLbcb->BufferOffset; 00365 } 00366 } 00367 00368 // 00369 // We are done with this page, update the fields in the page header. 00370 // 00371 00372 if (RemainingPageBytes == 0 00373 || RemainingLogBytes == 0) { 00374 00375 // 00376 // We are done with this page. Update the Lbcb and page header. 00377 // 00378 00379 ThisLbcb->LastLsn = NextLsn; 00380 PageHeader->Copy.LastLsn = NextLsn; 00381 PageHeader->Flags = ThisLbcb->Flags; 00382 00383 // 00384 // We can't put any more log records on this page. Remove 00385 // it from the active queue. 00386 // 00387 00388 if (RemainingPageBytes < Lfcb->RecordHeaderLength) { 00389 00390 RemoveHeadList( &Lfcb->LbcbActive ); 00391 ClearFlag( ThisLbcb->LbcbFlags, LBCB_ON_ACTIVE_QUEUE ); 00392 00393 // 00394 // If there are more log bytes then get the next Lbcb. 00395 // 00396 00397 if (RemainingLogBytes != 0) { 00398 00399 ThisLbcb = CONTAINING_RECORD( Lfcb->LbcbActive.Flink, 00400 LBCB, 00401 ActiveLinks ); 00402 00403 RemainingPageBytes = (ULONG)Lfcb->LogPageSize 00404 - (ULONG)ThisLbcb->BufferOffset; 00405 } 00406 } 00407 } 00408 } 00409 00410 *Lsn = NextLsn; 00411 00412 Lfcb->RestartArea->CurrentLsn = NextLsn; 00413 00414 Lfcb->RestartArea->LastLsnDataLength = OriginalLogBytes; 00415 00416 ClearFlag( Lfcb->Flags, LFCB_NO_LAST_LSN ); 00417 00418 DebugTrace( 0, Dbg, "Lsn (Low) -> %08lx\n", Lsn->LowPart ); 00419 DebugTrace( 0, Dbg, "Lsn (High) -> %08lx\n", Lsn->HighPart ); 00420 DebugTrace( -1, Dbg, "LfsWriteLogRecordIntoLogPage: Exit\n", 0 ); 00421 00422 return LogFileFull; 00423 }


Generated on Sat May 15 19:44:33 2004 for test by doxygen 1.3.7