home *** CD-ROM | disk | FTP | other *** search
- /*
- * $RCSfile: space.c,v $
- * $Revision: 1.1.1.1 $
- * $Date: 1996/05/04 21:55:49 $
- */
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
-
- #include "sysdefs.h"
- #include "ess.h"
- #include "checking.h"
- #include "trace.h"
- #include "error.h"
- #include "list.h"
- #include "pool.h"
- #include "tid.h"
- #include "io.h"
- #include "lock.h"
- #include "object.h"
- #include "msgdefs.h"
- #include "thread.h"
- #include "semaphore.h"
- #include "latch.h"
- #include "link.h"
- #include "lsn.h"
- #include "bf.h"
- #include "volume.h"
- #include "openlog.h"
- #include "log_globals.h"
- #include "logrecs.h"
-
-
- OPENLOG OpenLog;
- LINK LogLink;
- BOOL RecoverLog = TRUE;
-
- /*
- * Control preflushing of log pages
- */
- BOOL LogPreflushOn = TRUE;
-
- /*
- * All volumes mounted by transactions at the time of a
- * checkpoint, and the count
- */
- VOLIDNAME *CheckpointVolumes = NULL;
- unsigned int CheckpointVolumeCount;
-
- /*
- * LSN of the checkpoint record for the most recent checkpoint for
- * which all pages in the dirty page table were flushed.
- */
- LSN LastFlushedCheckpoint;
-
- /*
- * LSN of the oldest dirty page (based on pageHash->lsn).
- * This is calculated when a checkpoint is taken, and is used
- * in determining when space can be reused. Log space can be reused
- * up the OldestDirtyPageLSN (assuming there are no active transaction
- * with log records there).
- */
- LSN OldestDirtyPageLSN;
-
- /* log preflush thread flushes to this mark */
- FORCEMARK LogPreflushMark;
-
- /* number of potentially dirty pages in the log write buffer group */
- int PotentialDirtyLogPages;
-
- /* log preflush thread waits on this list */
- LIST LogPreflushWaitList;
-
- /* preflush log more than this many pages are available */
- int LogPreflushTarget = MAX_IO_LIST-1;
-
- /* checkpoint thread waits on this list */
- LIST CheckpointWaitList;
-
- /* asynchrounous page flush thread waits here */
- LIST DirtyPageFlushWaitList;
-
- /* indicates if checkpoint thread should synch force dirty pages */
- BOOL CheckpointSyncForce;
-
- /*
- * Indicates whether checkpoints can be taken at this time.
- * The only time they cannot be taken is during analysis, redo,
- * and log regeneration.
- */
- BOOL CheckpointsEnabled = TRUE;
-
- /* total log space used by active transactions */
- unsigned int ActiveLogSpace = 0;
-
- /* Starting wrap count option for the log */
- int LogStartWrapCount = NULL_LOG_WRAP_COUNT;
-