home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / serverlib / log / space.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  3.6 KB  |  126 lines

  1. /*
  2.  *   $RCSfile: space.c,v $  
  3.  *   $Revision: 1.1.1.1 $  
  4.  *   $Date: 1996/05/04 21:55:49 $      
  5.  */ 
  6. /**********************************************************************
  7. * EXODUS Database Toolkit Software
  8. * Copyright (c) 1991 Computer Sciences Department, University of
  9. *                    Wisconsin -- Madison
  10. * All Rights Reserved.
  11. *
  12. * Permission to use, copy, modify and distribute this software and its
  13. * documentation is hereby granted, provided that both the copyright
  14. * notice and this permission notice appear in all copies of the
  15. * software, derivative works or modified versions, and any portions
  16. * thereof, and that both notices appear in supporting documentation.
  17. *
  18. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  19. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  20. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  21. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  22. *
  23. * The EXODUS Project Group requests users of this software to return 
  24. * any improvements or extensions that they make to:
  25. *
  26. *   EXODUS Project Group 
  27. *     c/o David J. DeWitt and Michael J. Carey
  28. *   Computer Sciences Department
  29. *   University of Wisconsin -- Madison
  30. *   Madison, WI 53706
  31. *
  32. *     or exodus@cs.wisc.edu
  33. *
  34. * In addition, the EXODUS Project Group requests that users grant the 
  35. * Computer Sciences Department rights to redistribute these changes.
  36. **********************************************************************/
  37.  
  38. #include "sysdefs.h"
  39. #include "ess.h"
  40. #include "checking.h"
  41. #include "trace.h"
  42. #include "error.h"
  43. #include "list.h"
  44. #include "pool.h"
  45. #include "tid.h"
  46. #include "io.h"
  47. #include "lock.h"
  48. #include "object.h"
  49. #include "msgdefs.h"
  50. #include "thread.h"
  51. #include "semaphore.h"
  52. #include "latch.h"
  53. #include "link.h"
  54. #include "lsn.h"
  55. #include "bf.h"
  56. #include "volume.h"
  57. #include "openlog.h"
  58. #include "log_globals.h"
  59. #include "logrecs.h"
  60.  
  61.  
  62. OPENLOG        OpenLog;
  63. LINK        LogLink;
  64. BOOL        RecoverLog = TRUE;
  65.  
  66. /*
  67.  *  Control preflushing of log pages
  68.  */
  69. BOOL         LogPreflushOn = TRUE;
  70.  
  71. /*
  72.  *    All volumes mounted by transactions at the time of a
  73.  *    checkpoint, and the count
  74.  */
  75. VOLIDNAME    *CheckpointVolumes = NULL;
  76. unsigned int        CheckpointVolumeCount;
  77.  
  78. /*
  79.  *    LSN of the checkpoint record for the most recent checkpoint for 
  80.  *    which all pages in the dirty page table were flushed.
  81.  */
  82. LSN            LastFlushedCheckpoint;
  83.  
  84. /*
  85.  *    LSN of the oldest dirty page (based on pageHash->lsn).
  86.  *    This is calculated when a checkpoint is taken, and is used
  87.  *    in determining when space can be reused.  Log space can be reused
  88.  *    up the OldestDirtyPageLSN (assuming there are no active transaction
  89.  *    with log records there).
  90.  */
  91. LSN            OldestDirtyPageLSN;
  92.  
  93. /* log preflush thread flushes to this mark */
  94. FORCEMARK    LogPreflushMark;
  95.  
  96. /* number of potentially dirty pages in the log write buffer group */
  97. int            PotentialDirtyLogPages;
  98.  
  99. /* log preflush thread waits on this list */
  100. LIST        LogPreflushWaitList;
  101.  
  102. /* preflush log more than this many pages are available */
  103. int            LogPreflushTarget = MAX_IO_LIST-1;
  104.  
  105. /* checkpoint thread waits on this list */
  106. LIST        CheckpointWaitList;
  107.  
  108. /* asynchrounous page flush thread waits here */
  109. LIST        DirtyPageFlushWaitList;
  110.  
  111. /* indicates if checkpoint thread should synch force dirty pages */
  112. BOOL        CheckpointSyncForce;
  113.  
  114. /*
  115.  *    Indicates whether checkpoints can be taken at this time.
  116.  *    The only time they cannot be taken is during analysis, redo,
  117.  *    and log regeneration.
  118.  */
  119. BOOL         CheckpointsEnabled = TRUE;
  120.  
  121. /* total log space used by active transactions */
  122. unsigned int     ActiveLogSpace = 0;
  123.  
  124. /* Starting wrap count option for the log */
  125. int            LogStartWrapCount = NULL_LOG_WRAP_COUNT;
  126.