Go to the source code of this file.
Classes | |
struct | Pager |
Defines | |
#define | PAGERTRACE1(X) |
#define | PAGERTRACE2(X, Y) |
#define | PAGERTRACE3(X, Y, Z) |
#define | PAGERTRACE4(X, Y, Z, W) |
#define | PAGERTRACE5(X, Y, Z, W, V) |
#define | PAGERID(p) ((int)(p->fd)) |
#define | FILEHANDLEID(fd) ((int)fd) |
#define | PAGER_UNLOCK 0 |
#define | PAGER_SHARED 1 |
#define | PAGER_RESERVED 2 |
#define | PAGER_EXCLUSIVE 4 |
#define | PAGER_SYNCED 5 |
#define | SQLITE_BUSY_RESERVED_LOCK 0 |
#define | FORCE_ALIGNMENT(X) (((X)+7)&~7) |
#define | CODEC1(P, D, N, X) |
#define | CODEC2(P, D, N, X) ((char*)D) |
#define | PAGER_INCR(v) |
#define | JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8) |
#define | JOURNAL_HDR_SZ(pPager) (pPager->sectorSize) |
#define | MEMDB pPager->memDb |
#define | PAGER_MJ_PGNO(x) ((PENDING_BYTE/((x)->pageSize))+1) |
#define | PAGER_MAX_PGNO 2147483647 |
#define | put32bits(A, B) sqlite3Put4byte((u8*)A,B) |
#define | pager_datahash(X, Y) 0 |
#define | pager_pagehash(X) 0 |
#define | CHECK_PAGE(x) |
#define | disable_simulated_io_errors() |
#define | enable_simulated_io_errors() |
Functions | |
static int | pageInStatement (PgHdr *pPg) |
static int | read32bits (sqlite3_file *fd, i64 offset, u32 *pRes) |
static int | write32bits (sqlite3_file *fd, i64 offset, u32 val) |
static int | osUnlock (sqlite3_file *pFd, int eLock) |
static void | pager_unlock (Pager *pPager) |
static int | pager_error (Pager *pPager, int rc) |
static int | readMasterJournal (sqlite3_file *pJrnl, char *zMaster, int nMaster) |
static void | seekJournalHdr (Pager *pPager) |
static int | zeroJournalHdr (Pager *pPager, int doTruncate) |
static int | writeJournalHdr (Pager *pPager) |
static int | readJournalHdr (Pager *pPager, i64 journalSize, u32 *pNRec, u32 *pDbSize) |
static int | writeMasterJournal (Pager *pPager, const char *zMaster) |
static PgHdr * | pager_lookup (Pager *pPager, Pgno pgno) |
static void | pager_reset (Pager *pPager) |
static void | pagerUnlockAndRollback (Pager *p) |
static int | pager_end_transaction (Pager *pPager, int hasMaster) |
static u32 | pager_cksum (Pager *pPager, const u8 *aData) |
static void | makeClean (PgHdr *) |
static int | pager_playback_one_page (Pager *pPager, sqlite3_file *jfd, i64 offset, int isMainJrnl) |
static int | pager_delmaster (Pager *pPager, const char *zMaster) |
static void | pager_truncate_cache (Pager *pPager) |
static int | pager_truncate (Pager *pPager, int nPage) |
static void | setSectorSize (Pager *pPager) |
static int | pager_playback (Pager *pPager, int isHot) |
static int | pager_stmt_playback (Pager *pPager) |
void | sqlite3PagerSetCachesize (Pager *pPager, int mxPage) |
void | sqlite3PagerSetSafetyLevel (Pager *pPager, int level, int bFullFsync) |
static int | sqlite3PagerOpentemp (Pager *pPager, sqlite3_file *pFile, int vfsFlags) |
static int | pagerStress (void *, PgHdr *) |
int | sqlite3PagerOpen (sqlite3_vfs *pVfs, Pager **ppPager, const char *zFilename, int nExtra, int flags, int vfsFlags) |
void | sqlite3PagerSetBusyhandler (Pager *pPager, BusyHandler *pBusyHandler) |
void | sqlite3PagerSetReiniter (Pager *pPager, void(*xReinit)(DbPage *)) |
int | sqlite3PagerSetPagesize (Pager *pPager, u16 *pPageSize) |
void * | sqlite3PagerTempSpace (Pager *pPager) |
int | sqlite3PagerMaxPageCount (Pager *pPager, int mxPage) |
int | sqlite3PagerReadFileheader (Pager *pPager, int N, unsigned char *pDest) |
int | sqlite3PagerPagecount (Pager *pPager, int *pnPage) |
static int | syncJournal (Pager *) |
static int | pager_wait_on_lock (Pager *pPager, int locktype) |
int | sqlite3PagerTruncate (Pager *pPager, Pgno nPage) |
int | sqlite3PagerClose (Pager *pPager) |
int | sqlite3PagerRef (DbPage *pPg) |
static int | pager_write_pagelist (PgHdr *pList) |
static int | hasHotJournal (Pager *pPager, int *pExists) |
static int | readDbPage (Pager *pPager, PgHdr *pPg, Pgno pgno) |
static int | pagerSharedLock (Pager *pPager) |
static int | pager_get_content (PgHdr *pPg) |
static void | pagerUnlockIfUnused (Pager *pPager) |
static void | pagerDropPage (DbPage *pPg) |
int | sqlite3PagerAcquire (Pager *pPager, Pgno pgno, DbPage **ppPage, int noContent) |
DbPage * | sqlite3PagerLookup (Pager *pPager, Pgno pgno) |
int | sqlite3PagerUnref (DbPage *pPg) |
static int | pager_open_journal (Pager *pPager) |
int | sqlite3PagerBegin (DbPage *pPg, int exFlag) |
static void | makeDirty (PgHdr *pPg) |
static int | pager_write (PgHdr *pPg) |
int | sqlite3PagerWrite (DbPage *pDbPage) |
int | sqlite3PagerDontWrite (DbPage *pDbPage) |
void | sqlite3PagerDontRollback (DbPage *pPg) |
static int | pager_incr_changecounter (Pager *pPager, int isDirect) |
int | sqlite3PagerSync (Pager *pPager) |
int | sqlite3PagerCommitPhaseOne (Pager *pPager, const char *zMaster, Pgno nTrunc, int noSync) |
int | sqlite3PagerCommitPhaseTwo (Pager *pPager) |
int | sqlite3PagerRollback (Pager *pPager) |
int | sqlite3PagerIsreadonly (Pager *pPager) |
int | sqlite3PagerRefcount (Pager *pPager) |
int | sqlite3PagerPageRefcount (DbPage *pPage) |
static int | pagerStmtBegin (Pager *pPager) |
int | sqlite3PagerStmtBegin (Pager *pPager) |
int | sqlite3PagerStmtCommit (Pager *pPager) |
int | sqlite3PagerStmtRollback (Pager *pPager) |
const char * | sqlite3PagerFilename (Pager *pPager) |
const sqlite3_vfs * | sqlite3PagerVfs (Pager *pPager) |
sqlite3_file * | sqlite3PagerFile (Pager *pPager) |
const char * | sqlite3PagerDirname (Pager *pPager) |
const char * | sqlite3PagerJournalname (Pager *pPager) |
int | sqlite3PagerNosync (Pager *pPager) |
int | sqlite3PagerMovepage (Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit) |
void * | sqlite3PagerGetData (DbPage *pPg) |
void * | sqlite3PagerGetExtra (DbPage *pPg) |
int | sqlite3PagerLockingMode (Pager *pPager, int eMode) |
int | sqlite3PagerJournalMode (Pager *pPager, int eMode) |
i64 | sqlite3PagerJournalSizeLimit (Pager *pPager, i64 iLimit) |
Variables | |
static const unsigned char | aJournalMagic [] |
#define CHECK_PAGE | ( | x | ) |
Definition at line 476 of file pager.c.
Referenced by pager_write().
#define CODEC1 | ( | P, | |||
D, | |||||
N, | |||||
X | ) |
Definition at line 139 of file pager.c.
Referenced by pager_playback_one_page(), and readDbPage().
#define CODEC2 | ( | P, | |||
D, | |||||
N, | |||||
X | ) | ((char*)D) |
Definition at line 140 of file pager.c.
Referenced by pager_write(), and pager_write_pagelist().
#define disable_simulated_io_errors | ( | ) |
Definition at line 2045 of file pager.c.
Referenced by sqlite3PagerClose(), and vdbeCommit().
#define enable_simulated_io_errors | ( | ) |
Definition at line 2046 of file pager.c.
Referenced by sqlite3PagerClose(), and vdbeCommit().
#define FILEHANDLEID | ( | fd | ) | ((int)fd) |
Definition at line 53 of file pager.c.
Referenced by sqlite3PagerOpen().
#define FORCE_ALIGNMENT | ( | X | ) | (((X)+7)&~7) |
Definition at line 130 of file pager.c.
Referenced by sqlite3PagerOpen().
#define JOURNAL_HDR_SZ | ( | pPager | ) | (pPager->sectorSize) |
Definition at line 276 of file pager.c.
Referenced by pager_playback(), readJournalHdr(), seekJournalHdr(), and writeJournalHdr().
#define JOURNAL_PG_SZ | ( | pPager | ) | ((pPager->pageSize) + 8) |
Definition at line 269 of file pager.c.
Referenced by pager_playback().
#define MEMDB pPager->memDb |
Definition at line 287 of file pager.c.
Referenced by pager_end_transaction(), pagerSharedLock(), readDbPage(), sqlite3PagerAcquire(), sqlite3PagerBegin(), sqlite3PagerClose(), sqlite3PagerCommitPhaseOne(), sqlite3PagerCommitPhaseTwo(), sqlite3PagerJournalMode(), sqlite3PagerMovepage(), sqlite3PagerRollback(), sqlite3PagerSync(), and sqlite3PagerWrite().
#define pager_datahash | ( | X, | |||
Y | ) | 0 |
Definition at line 474 of file pager.c.
Referenced by pager_playback_one_page().
#define PAGER_EXCLUSIVE 4 |
Definition at line 106 of file pager.c.
Referenced by pager_end_transaction(), pager_playback_one_page(), pager_truncate(), pager_wait_on_lock(), pagerSharedLock(), sqlite3PagerOpen(), and sqlite3PagerRollback().
#define PAGER_INCR | ( | v | ) |
Definition at line 233 of file pager.c.
Referenced by pager_write(), pager_write_pagelist(), readDbPage(), and sqlite3PagerAcquire().
#define PAGER_MAX_PGNO 2147483647 |
Definition at line 303 of file pager.c.
Referenced by sqlite3PagerAcquire().
#define PAGER_MJ_PGNO | ( | x | ) | ((PENDING_BYTE/((x)->pageSize))+1) |
Definition at line 298 of file pager.c.
Referenced by pager_playback_one_page(), pager_write(), sqlite3PagerAcquire(), sqlite3PagerCommitPhaseOne(), sqlite3PagerWrite(), and writeMasterJournal().
#define pager_pagehash | ( | X | ) | 0 |
Definition at line 475 of file pager.c.
Referenced by pager_playback_one_page(), pager_write(), pager_write_pagelist(), readDbPage(), sqlite3PagerAcquire(), and sqlite3PagerDontWrite().
#define PAGER_RESERVED 2 |
Definition at line 105 of file pager.c.
Referenced by pager_end_transaction(), pager_open_journal(), pager_playback_one_page(), pager_wait_on_lock(), pager_write(), pagerUnlockAndRollback(), sqlite3PagerBegin(), sqlite3PagerCommitPhaseTwo(), sqlite3PagerDontRollback(), and sqlite3PagerRollback().
#define PAGER_SHARED 1 |
Definition at line 104 of file pager.c.
Referenced by pager_end_transaction(), pager_stmt_playback(), pager_wait_on_lock(), pager_write(), pagerSharedLock(), pagerStmtBegin(), sqlite3PagerBegin(), sqlite3PagerDontWrite(), and sqlite3PagerTruncate().
#define PAGER_SYNCED 5 |
Definition at line 107 of file pager.c.
Referenced by pager_end_transaction(), sqlite3PagerCommitPhaseOne(), and sqlite3PagerCommitPhaseTwo().
#define PAGER_UNLOCK 0 |
Definition at line 103 of file pager.c.
Referenced by pager_error(), pager_unlock(), pager_write(), pagerSharedLock(), sqlite3PagerAcquire(), sqlite3PagerBegin(), sqlite3PagerLookup(), sqlite3PagerOpen(), and sqlite3PagerPagecount().
#define PAGERID | ( | p | ) | ((int)(p->fd)) |
Definition at line 52 of file pager.c.
Referenced by pager_playback_one_page(), pager_write(), pager_write_pagelist(), pagerStmtBegin(), readDbPage(), sqlite3PagerBegin(), sqlite3PagerClose(), sqlite3PagerCommitPhaseTwo(), sqlite3PagerDontRollback(), sqlite3PagerDontWrite(), sqlite3PagerMovepage(), sqlite3PagerRollback(), sqlite3PagerStmtCommit(), sqlite3PagerStmtRollback(), and syncJournal().
#define PAGERTRACE2 | ( | X, | |||
Y | ) |
Definition at line 38 of file pager.c.
Referenced by pagerStmtBegin(), sqlite3PagerBegin(), sqlite3PagerClose(), sqlite3PagerCommitPhaseTwo(), sqlite3PagerRollback(), sqlite3PagerStmtCommit(), sqlite3PagerStmtRollback(), and syncJournal().
#define PAGERTRACE3 | ( | X, | |||
Y, | |||||
Z | ) |
Definition at line 39 of file pager.c.
Referenced by pager_write(), pager_write_pagelist(), sqlite3PagerDontRollback(), sqlite3PagerDontWrite(), and sqlite3PagerOpen().
#define PAGERTRACE4 | ( | X, | |||
Y, | |||||
Z, | |||||
W | ) |
Definition at line 40 of file pager.c.
Referenced by pager_playback_one_page(), pager_write(), pager_write_pagelist(), readDbPage(), and sqlite3PagerCommitPhaseOne().
#define PAGERTRACE5 | ( | X, | |||
Y, | |||||
Z, | |||||
W, | |||||
V | ) |
Definition at line 41 of file pager.c.
Referenced by pager_write(), and sqlite3PagerMovepage().
#define put32bits | ( | A, | |||
B | ) | sqlite3Put4byte((u8*)A,B) |
Definition at line 334 of file pager.c.
Referenced by pager_incr_changecounter(), write32bits(), writeJournalHdr(), and writeMasterJournal().
static int hasHotJournal | ( | Pager * | pPager, | |
int * | pExists | |||
) | [static] |
Definition at line 2497 of file pager.c.
References Pager::fd, sqlite3_file::pMethods, Pager::pVfs, sqlite3OsAccess(), sqlite3OsCheckReservedLock(), sqlite3OsDelete(), sqlite3PagerPagecount(), SQLITE_ACCESS_EXISTS, SQLITE_OK, Pager::useJournal, and Pager::zJournal.
Referenced by pagerSharedLock().
static void makeClean | ( | PgHdr * | pPg | ) | [static] |
Definition at line 3113 of file pager.c.
References sqlite3PcacheMakeClean().
Referenced by pager_playback_one_page().
static void makeDirty | ( | PgHdr * | pPg | ) | [static] |
Definition at line 3105 of file pager.c.
References sqlite3PcacheMakeDirty().
Referenced by pager_write(), and sqlite3PagerMovepage().
static int osUnlock | ( | sqlite3_file * | pFd, | |
int | eLock | |||
) | [static] |
Definition at line 349 of file pager.c.
References sqlite3_file::pMethods, sqlite3OsUnlock(), and SQLITE_OK.
Referenced by pager_end_transaction(), and pager_unlock().
static int pageInStatement | ( | PgHdr * | pPg | ) | [static] |
Definition at line 310 of file pager.c.
References PgHdr::pgno, Pager::pInStmt, PgHdr::pPager, and sqlite3BitvecTest().
Referenced by pager_write().
Definition at line 1051 of file pager.c.
References Pager::cksumInit, and Pager::pageSize.
Referenced by pager_playback_one_page(), and pager_write().
static int pager_delmaster | ( | Pager * | pPager, | |
const char * | zMaster | |||
) | [static] |
Definition at line 1205 of file pager.c.
References sqlite3_vfs::mxPathname, Pager::pVfs, readMasterJournal(), sqlite3_free(), sqlite3Malloc(), sqlite3OsAccess(), sqlite3OsClose(), sqlite3OsDelete(), sqlite3OsFileSize(), sqlite3OsOpen(), sqlite3OsRead(), SQLITE_ACCESS_EXISTS, SQLITE_NOMEM, SQLITE_OK, SQLITE_OPEN_MAIN_JOURNAL, SQLITE_OPEN_MASTER_JOURNAL, SQLITE_OPEN_READONLY, and sqlite3_vfs::szOsFile.
Referenced by pager_playback().
static int pager_end_transaction | ( | Pager * | pPager, | |
int | hasMaster | |||
) | [static] |
Definition at line 958 of file pager.c.
References Pager::dbModified, Pager::dbSize, Pager::dirtyCache, Pager::exclusiveMode, Pager::fd, Pager::jfd, Pager::journalMode, Pager::journalOff, Pager::journalOpen, Pager::journalStarted, MEMDB, Pager::needSync, Pager::nRec, Pager::origDbSize, osUnlock(), pager_error(), PAGER_EXCLUSIVE, PAGER_JOURNALMODE_DELETE, PAGER_JOURNALMODE_MEMORY, PAGER_JOURNALMODE_PERSIST, PAGER_JOURNALMODE_TRUNCATE, PAGER_RESERVED, PAGER_SHARED, PAGER_SYNCED, Pager::pAlwaysRollback, PGHDR_IN_JOURNAL, PGHDR_NEED_SYNC, Pager::pInJournal, Pager::pPCache, Pager::pVfs, Pager::setMaster, SHARED_LOCK, sqlite3BitvecDestroy(), sqlite3IsMemJournal(), sqlite3OsClose(), sqlite3OsDelete(), sqlite3OsTruncate(), sqlite3PagerStmtCommit(), sqlite3PcacheCleanAll(), sqlite3PcacheClearFlags(), SQLITE_OK, Pager::state, Pager::stfd, Pager::stmtOpen, Pager::tempFile, zeroJournalHdr(), and Pager::zJournal.
Referenced by pager_open_journal(), pager_playback(), sqlite3PagerCommitPhaseTwo(), and sqlite3PagerRollback().
static int pager_error | ( | Pager * | pPager, | |
int | rc | |||
) | [static] |
Definition at line 411 of file pager.c.
References Pager::errCode, pager_unlock(), PAGER_UNLOCK, Pager::pPCache, sqlite3PcacheRefCount(), SQLITE_CORRUPT, SQLITE_FULL, SQLITE_IOERR, SQLITE_OK, and Pager::state.
Referenced by pager_end_transaction(), pagerSharedLock(), pagerStress(), sqlite3PagerCommitPhaseTwo(), sqlite3PagerPagecount(), and sqlite3PagerRollback().
static int pager_get_content | ( | PgHdr * | pPg | ) | [static] |
Definition at line 2740 of file pager.c.
References PgHdr::flags, PGHDR_NEED_READ, PgHdr::pgno, PgHdr::pPager, readDbPage(), and SQLITE_OK.
Referenced by pager_write(), sqlite3PagerAcquire(), and sqlite3PagerMovepage().
static int pager_incr_changecounter | ( | Pager * | pPager, | |
int | isDirect | |||
) | [static] |
Definition at line 3533 of file pager.c.
References Pager::changeCountDone, Pager::dbFileVers, Pager::fd, Pager::pageSize, PgHdr::pData, sqlite3_file::pMethods, put32bits, sqlite3Get4byte(), sqlite3OsWrite(), sqlite3PagerGet, sqlite3PagerUnref(), sqlite3PagerWrite(), and SQLITE_OK.
Referenced by sqlite3PagerCommitPhaseOne().
Definition at line 856 of file pager.c.
References Pager::pPCache, and sqlite3PcacheFetch().
Referenced by pager_playback_one_page(), sqlite3PagerMovepage(), and sqlite3PagerWrite().
static int pager_open_journal | ( | Pager * | pPager | ) | [static] |
Definition at line 2953 of file pager.c.
References Pager::dbSize, Pager::errCode, Pager::jfd, Pager::journalHdr, Pager::journalMode, Pager::journalOff, Pager::journalOpen, Pager::journalStarted, Pager::needSync, Pager::nRec, Pager::origDbSize, pager_end_transaction(), PAGER_JOURNALMODE_MEMORY, PAGER_RESERVED, Pager::pInJournal, sqlite3_file::pMethods, Pager::pVfs, Pager::setMaster, sqlite3BitvecCreate(), sqlite3BitvecDestroy(), sqlite3MemJournalOpen(), sqlite3OsDelete(), sqlite3OsOpen(), sqlite3PagerPagecount(), sqlite3PagerStmtBegin(), SQLITE_FULL, SQLITE_IOERR_NOMEM, SQLITE_NOMEM, SQLITE_OK, SQLITE_OPEN_CREATE, SQLITE_OPEN_DELETEONCLOSE, SQLITE_OPEN_EXCLUSIVE, SQLITE_OPEN_MAIN_JOURNAL, SQLITE_OPEN_READWRITE, SQLITE_OPEN_TEMP_JOURNAL, Pager::state, Pager::stmtAutoopen, Pager::tempFile, Pager::useJournal, writeJournalHdr(), and Pager::zJournal.
Referenced by pager_write(), and sqlite3PagerBegin().
static int pager_playback | ( | Pager * | pPager, | |
int | isHot | |||
) | [static] |
Definition at line 1409 of file pager.c.
References Pager::jfd, JOURNAL_HDR_SZ, JOURNAL_PG_SZ, Pager::journalHdr, Pager::journalOff, Pager::journalOpen, sqlite3_vfs::mxPathname, pager_delmaster(), pager_end_transaction(), pager_playback_one_page(), pager_truncate(), Pager::pTmpSpace, Pager::pVfs, readJournalHdr(), readMasterJournal(), setSectorSize(), sqlite3OsAccess(), sqlite3OsFileSize(), SQLITE_ACCESS_EXISTS, SQLITE_CORRUPT_BKPT, SQLITE_DONE, and SQLITE_OK.
Referenced by pagerSharedLock(), and sqlite3PagerRollback().
static int pager_playback_one_page | ( | Pager * | pPager, | |
sqlite3_file * | jfd, | |||
i64 | offset, | |||
int | isMainJrnl | |||
) | [static] |
Definition at line 1072 of file pager.c.
References CODEC1, Pager::dbFileVers, Pager::dbSize, Pager::fd, PgHdr::flags, Pager::jfd, Pager::journalOff, makeClean(), pager_cksum(), pager_datahash, PAGER_EXCLUSIVE, pager_lookup(), PAGER_MJ_PGNO, pager_pagehash, PAGER_RESERVED, PAGERID, PAGERTRACE4, Pager::pageSize, PgHdr::pData, PGHDR_NEED_SYNC, PgHdr::pgno, sqlite3_file::pMethods, Pager::pTmpSpace, read32bits(), sqlite3OsRead(), sqlite3OsWrite(), sqlite3PcacheRelease(), SQLITE_DONE, SQLITE_OK, Pager::state, Pager::stfd, and Pager::xReiniter.
Referenced by pager_playback(), and pager_stmt_playback().
static void pager_reset | ( | Pager * | pPager | ) | [static] |
Definition at line 868 of file pager.c.
References Pager::errCode, Pager::pPCache, and sqlite3PcacheClear().
Referenced by pager_unlock(), pagerSharedLock(), sqlite3PagerClose(), and sqlite3PagerSetPagesize().
static int pager_stmt_playback | ( | Pager * | pPager | ) | [static] |
Definition at line 1554 of file pager.c.
References Pager::cksumInit, Pager::fullSync, Pager::jfd, Pager::journalOff, Pager::journalOpen, pager_playback_one_page(), PAGER_SHARED, pager_truncate(), Pager::pageSize, readJournalHdr(), SQLITE_DONE, SQLITE_OK, Pager::state, Pager::stfd, Pager::stmtCksum, Pager::stmtHdrOff, Pager::stmtInUse, Pager::stmtJSize, Pager::stmtNRec, and Pager::stmtSize.
Referenced by sqlite3PagerStmtRollback().
static int pager_truncate | ( | Pager * | pPager, | |
int | nPage | |||
) | [static] |
Definition at line 1312 of file pager.c.
References Pager::dbSize, Pager::fd, PAGER_EXCLUSIVE, pager_truncate_cache(), Pager::pageSize, sqlite3_file::pMethods, sqlite3OsFileSize(), sqlite3OsTruncate(), sqlite3OsWrite(), SQLITE_OK, and Pager::state.
Referenced by pager_playback(), pager_stmt_playback(), and sqlite3PagerTruncate().
static void pager_truncate_cache | ( | Pager * | pPager | ) | [static] |
Definition at line 2137 of file pager.c.
References Pager::dbSize, Pager::pPCache, and sqlite3PcacheTruncate().
Referenced by pager_truncate().
static void pager_unlock | ( | Pager * | pPager | ) | [static] |
Definition at line 882 of file pager.c.
References Pager::changeCountDone, Pager::dbSize, Pager::errCode, Pager::exclusiveMode, Pager::fd, IOTRACE, Pager::jfd, Pager::journalOff, Pager::journalOpen, Pager::journalStarted, NO_LOCK, Pager::origDbSize, osUnlock(), pager_reset(), PAGER_UNLOCK, Pager::pAlwaysRollback, Pager::pInJournal, Pager::pInStmt, sqlite3BitvecDestroy(), sqlite3OsClose(), SQLITE_OK, Pager::state, Pager::stfd, Pager::stmtAutoopen, Pager::stmtInUse, and Pager::stmtOpen.
Referenced by pager_error(), pagerSharedLock(), and pagerUnlockAndRollback().
static int pager_wait_on_lock | ( | Pager * | pPager, | |
int | locktype | |||
) | [static] |
Definition at line 2149 of file pager.c.
References Pager::dbSize, EXCLUSIVE_LOCK, Pager::fd, IOTRACE, BusyHandler::nBusy, PAGER_EXCLUSIVE, PAGER_RESERVED, PAGER_SHARED, Pager::pBusyHandler, RESERVED_LOCK, SHARED_LOCK, sqlite3InvokeBusyHandler(), sqlite3OsLock(), SQLITE_BUSY, SQLITE_OK, and Pager::state.
Referenced by pager_write_pagelist(), pagerSharedLock(), sqlite3PagerBegin(), and sqlite3PagerTruncate().
static int pager_write | ( | PgHdr * | pPg | ) | [static] |
Definition at line 3135 of file pager.c.
References CHECK_PAGE, CODEC2, Pager::dbModified, Pager::dbSize, Pager::dirtyCache, Pager::errCode, PgHdr::flags, IOTRACE, Pager::jfd, Pager::journalMode, Pager::journalOff, Pager::journalOpen, Pager::journalStarted, makeDirty(), Pager::needSync, Pager::noSync, Pager::nRec, Pager::origDbSize, pageInStatement(), pager_cksum(), pager_get_content(), PAGER_INCR, PAGER_JOURNALMODE_OFF, PAGER_MJ_PGNO, pager_open_journal(), pager_pagehash, PAGER_RESERVED, PAGER_SHARED, PAGER_UNLOCK, PAGERID, PAGERTRACE3, PAGERTRACE4, PAGERTRACE5, Pager::pageSize, PgHdr::pData, PENDING_BYTE, PGHDR_IN_JOURNAL, PGHDR_NEED_SYNC, PgHdr::pgno, Pager::pInJournal, Pager::pInStmt, PgHdr::pPager, Pager::readOnly, Pager::setMaster, sqlite3BitvecSet(), sqlite3OsWrite(), sqlite3PagerBegin(), SQLITE_OK, SQLITE_PERM, Pager::state, Pager::stfd, Pager::stmtInUse, Pager::stmtNRec, Pager::stmtSize, Pager::useJournal, and write32bits().
Referenced by sqlite3PagerWrite().
static int pager_write_pagelist | ( | PgHdr * | pList | ) | [static] |
Definition at line 2365 of file pager.c.
References CODEC2, Pager::dbFileVers, Pager::dbSize, EXCLUSIVE_LOCK, Pager::fd, PgHdr::flags, IOTRACE, PAGER_INCR, pager_pagehash, pager_wait_on_lock(), PAGERID, PAGERTRACE3, PAGERTRACE4, Pager::pageSize, PgHdr::pData, PgHdr::pDirty, PGHDR_DONT_WRITE, PgHdr::pgno, sqlite3_file::pMethods, PgHdr::pPager, sqlite3OsWrite(), sqlite3PagerOpentemp(), SQLITE_OK, Pager::tempFile, and Pager::vfsFlags.
Referenced by pagerStress(), and sqlite3PagerCommitPhaseOne().
static void pagerDropPage | ( | DbPage * | pPg | ) | [static] |
Definition at line 2770 of file pager.c.
References pagerUnlockIfUnused(), PgHdr::pPager, and sqlite3PcacheDrop().
Referenced by sqlite3PagerAcquire().
static int pagerSharedLock | ( | Pager * | pPager | ) | [static] |
Definition at line 2560 of file pager.c.
References Pager::dbFileVers, Pager::dbSize, Pager::errCode, EXCLUSIVE_LOCK, Pager::exclusiveMode, f(), Pager::fd, hasHotJournal(), IOTRACE, Pager::jfd, Pager::journalHdr, Pager::journalOff, Pager::journalOpen, Pager::journalStarted, MEMDB, Pager::noReadlock, pager_error(), PAGER_EXCLUSIVE, pager_playback(), pager_reset(), PAGER_SHARED, pager_unlock(), PAGER_UNLOCK, pager_wait_on_lock(), sqlite3_file::pMethods, Pager::pPCache, Pager::pVfs, Pager::setMaster, SHARED_LOCK, sqlite3OsAccess(), sqlite3OsClose(), sqlite3OsLock(), sqlite3OsOpen(), sqlite3OsRead(), sqlite3PagerPagecount(), sqlite3PcachePagecount(), sqlite3PcacheRefCount(), SQLITE_ACCESS_EXISTS, SQLITE_BUSY, SQLITE_CANTOPEN, SQLITE_FULL, SQLITE_OK, SQLITE_OPEN_MAIN_JOURNAL, SQLITE_OPEN_READONLY, SQLITE_OPEN_READWRITE, Pager::state, Pager::tempFile, and Pager::zJournal.
Referenced by sqlite3PagerAcquire().
static int pagerStmtBegin | ( | Pager * | pPager | ) | [static] |
Definition at line 3894 of file pager.c.
References Pager::cksumInit, Pager::dbSize, Pager::journalMode, Pager::journalOff, Pager::journalOpen, PAGER_JOURNALMODE_MEMORY, PAGER_SHARED, PAGERID, PAGERTRACE2, Pager::pInStmt, sqlite3BitvecCreate(), sqlite3BitvecDestroy(), sqlite3MemJournalOpen(), sqlite3PagerOpentemp(), SQLITE_NOMEM, SQLITE_OK, SQLITE_OPEN_SUBJOURNAL, Pager::state, Pager::stfd, Pager::stmtAutoopen, Pager::stmtCksum, Pager::stmtHdrOff, Pager::stmtInUse, Pager::stmtJSize, Pager::stmtNRec, Pager::stmtOpen, and Pager::stmtSize.
Referenced by sqlite3PagerStmtBegin().
static int pagerStress | ( | void * | p, | |
PgHdr * | pPg | |||
) | [static] |
Definition at line 2442 of file pager.c.
References Pager::doNotSync, Pager::errCode, Pager::fd, PgHdr::flags, Pager::fullSync, Pager::journalMode, Pager::nRec, pager_error(), PAGER_JOURNALMODE_MEMORY, pager_write_pagelist(), PgHdr::pDirty, PGHDR_DIRTY, PGHDR_NEED_SYNC, sqlite3OsDeviceCharacteristics(), sqlite3PcacheMakeClean(), SQLITE_IOCAP_SAFE_APPEND, SQLITE_OK, syncJournal(), and writeJournalHdr().
Referenced by sqlite3PagerOpen().
static void pagerUnlockAndRollback | ( | Pager * | p | ) | [static] |
Definition at line 932 of file pager.c.
References Pager::errCode, PAGER_RESERVED, pager_unlock(), sqlite3BeginBenignMalloc(), sqlite3EndBenignMalloc(), sqlite3PagerRollback(), SQLITE_OK, and Pager::state.
Referenced by pagerUnlockIfUnused(), and sqlite3PagerClose().
static void pagerUnlockIfUnused | ( | Pager * | pPager | ) | [static] |
Definition at line 2756 of file pager.c.
References Pager::exclusiveMode, Pager::journalOff, pagerUnlockAndRollback(), Pager::pPCache, and sqlite3PcacheRefCount().
Referenced by pagerDropPage(), and sqlite3PagerUnref().
static int read32bits | ( | sqlite3_file * | fd, | |
i64 | offset, | |||
u32 * | pRes | |||
) | [static] |
Definition at line 322 of file pager.c.
References sqlite3Get4byte(), sqlite3OsRead(), and SQLITE_OK.
Referenced by pager_playback_one_page(), readJournalHdr(), and readMasterJournal().
Definition at line 2527 of file pager.c.
References CODEC1, Pager::dbFileVers, Pager::fd, IOTRACE, MEMDB, PAGER_INCR, pager_pagehash, PAGERID, PAGERTRACE4, Pager::pageSize, PgHdr::pData, PgHdr::pgno, sqlite3_file::pMethods, sqlite3OsRead(), SQLITE_IOERR_SHORT_READ, and Pager::tempFile.
Referenced by pager_get_content(), and sqlite3PagerAcquire().
Definition at line 708 of file pager.c.
References aJournalMagic, Pager::cksumInit, Pager::jfd, JOURNAL_HDR_SZ, Pager::journalOff, read32bits(), Pager::sectorSize, seekJournalHdr(), sqlite3OsRead(), sqlite3PagerSetPagesize(), SQLITE_DONE, SQLITE_MAX_PAGE_SIZE, and SQLITE_OK.
Referenced by pager_playback(), and pager_stmt_playback().
static int readMasterJournal | ( | sqlite3_file * | pJrnl, | |
char * | zMaster, | |||
int | nMaster | |||
) | [static] |
Definition at line 494 of file pager.c.
References aJournalMagic, read32bits(), sqlite3OsFileSize(), sqlite3OsRead(), and SQLITE_OK.
Referenced by pager_delmaster(), and pager_playback().
static void seekJournalHdr | ( | Pager * | pPager | ) | [static] |
Definition at line 557 of file pager.c.
References JOURNAL_HDR_SZ, and Pager::journalOff.
Referenced by readJournalHdr(), writeJournalHdr(), and writeMasterJournal().
static void setSectorSize | ( | Pager * | pPager | ) | [static] |
Definition at line 1339 of file pager.c.
References Pager::fd, sqlite3_file::pMethods, Pager::sectorSize, sqlite3OsSectorSize(), and Pager::tempFile.
Referenced by pager_playback(), sqlite3PagerOpen(), and sqlite3PagerSetPagesize().
Definition at line 2808 of file pager.c.
References PgHdr::flags, IOTRACE, MEMDB, Pager::mxPgno, Pager::nExtra, pager_get_content(), PAGER_INCR, PAGER_MAX_PGNO, PAGER_MJ_PGNO, pager_pagehash, PAGER_UNLOCK, pagerDropPage(), pagerSharedLock(), Pager::pageSize, PgHdr::pData, PgHdr::pExtra, PGHDR_IN_JOURNAL, PGHDR_NEED_READ, Pager::pInJournal, PgHdr::pPager, Pager::pPCache, readDbPage(), sqlite3BitvecTest(), sqlite3PagerPagecount(), sqlite3PagerUnref(), sqlite3PcacheFetch(), sqlite3PcacheRefCount(), SQLITE_CORRUPT_BKPT, SQLITE_FULL, SQLITE_IOERR_SHORT_READ, SQLITE_OK, and Pager::state.
Referenced by sqlite3BtreeGetPage().
int sqlite3PagerBegin | ( | DbPage * | pPg, | |
int | exFlag | |||
) |
Definition at line 3053 of file pager.c.
References Pager::dbSize, Pager::dirtyCache, EXCLUSIVE_LOCK, Pager::fd, Pager::journalMode, Pager::journalOff, Pager::journalOpen, MEMDB, Pager::nRec, PgHdr::nRef, Pager::origDbSize, PAGER_JOURNALMODE_OFF, pager_open_journal(), PAGER_RESERVED, PAGER_SHARED, PAGER_UNLOCK, pager_wait_on_lock(), PAGERID, PAGERTRACE2, PGHDR_IN_JOURNAL, Pager::pInJournal, PgHdr::pPager, Pager::pPCache, RESERVED_LOCK, sqlite3BitvecCreate(), sqlite3OsLock(), sqlite3PagerPagecount(), sqlite3PcacheAssertFlags, SQLITE_NOMEM, SQLITE_OK, Pager::state, Pager::tempFile, Pager::useJournal, and writeJournalHdr().
Referenced by pager_write(), and sqlite3BtreeBeginTrans().
int sqlite3PagerClose | ( | Pager * | pPager | ) |
Definition at line 2213 of file pager.c.
References disable_simulated_io_errors, enable_simulated_io_errors, Pager::errCode, Pager::exclusiveMode, Pager::fd, IOTRACE, Pager::jfd, Pager::journalOpen, MEMDB, pager_reset(), PAGERID, PAGERTRACE2, pagerUnlockAndRollback(), Pager::pAlwaysRollback, Pager::pInJournal, Pager::pPCache, Pager::pTmpSpace, sqlite3_free(), sqlite3BeginBenignMalloc(), sqlite3BitvecDestroy(), sqlite3EndBenignMalloc(), sqlite3OsClose(), sqlite3PageFree(), sqlite3PcacheClose(), SQLITE_OK, Pager::stfd, and Pager::stmtOpen.
Referenced by sqlite3BtreeClose(), and sqlite3BtreeOpen().
Definition at line 3608 of file pager.c.
References aJournalMagic, Pager::dbModified, Pager::dirtyCache, Pager::errCode, Pager::exclusiveMode, Pager::fd, IOTRACE, Pager::jfd, Pager::journalHdr, Pager::journalMode, Pager::journalOff, Pager::journalOpen, MEMDB, Pager::noSync, Pager::nRec, Pager::origDbSize, pager_incr_changecounter(), PAGER_JOURNALMODE_DELETE, PAGER_JOURNALMODE_OFF, PAGER_MJ_PGNO, PAGER_SYNCED, pager_write_pagelist(), PAGERTRACE4, PgHdr::pDirty, Pager::pInJournal, Pager::pPCache, Pager::setMaster, sqlite3BitvecTest(), sqlite3OsSync(), sqlite3PagerGet, sqlite3PagerTruncate(), sqlite3PagerUnref(), sqlite3PagerWrite(), sqlite3PcacheCleanAll(), sqlite3PcacheDirtyList(), SQLITE_BUSY, SQLITE_IOERR_BLOCKED, SQLITE_OK, Pager::state, Pager::sync_flags, syncJournal(), write32bits(), writeMasterJournal(), and Pager::zFilename.
Referenced by btreeCopyFile(), and sqlite3BtreeCommitPhaseOne().
int sqlite3PagerCommitPhaseTwo | ( | Pager * | pPager | ) |
Definition at line 3772 of file pager.c.
References Pager::dbModified, Pager::dirtyCache, Pager::errCode, Pager::exclusiveMode, Pager::journalMode, Pager::journalOpen, MEMDB, pager_end_transaction(), pager_error(), PAGER_JOURNALMODE_DELETE, PAGER_RESERVED, PAGER_SYNCED, PAGERID, PAGERTRACE2, Pager::setMaster, SQLITE_ERROR, SQLITE_OK, and Pager::state.
Referenced by sqlite3BtreeCommitPhaseTwo().
const char* sqlite3PagerDirname | ( | Pager * | pPager | ) |
Definition at line 4003 of file pager.c.
References Pager::zDirectory.
Referenced by sqlite3BtreeGetDirname().
void sqlite3PagerDontRollback | ( | DbPage * | pPg | ) |
Definition at line 3482 of file pager.c.
References PgHdr::flags, IOTRACE, Pager::journalOpen, Pager::origDbSize, PAGER_RESERVED, PAGERID, PAGERTRACE3, Pager::pAlwaysRollback, PGHDR_IN_JOURNAL, PGHDR_NEED_READ, PgHdr::pgno, Pager::pInJournal, Pager::pInStmt, PgHdr::pPager, sqlite3BitvecSet(), sqlite3BitvecTest(), Pager::state, Pager::stmtInUse, and Pager::stmtSize.
Referenced by allocateBtreePage().
int sqlite3PagerDontWrite | ( | DbPage * | pDbPage | ) |
Definition at line 3431 of file pager.c.
References Pager::dbSize, PgHdr::flags, IOTRACE, Pager::origDbSize, pager_pagehash, PAGER_SHARED, PAGERID, PAGERTRACE3, Pager::pAlwaysRollback, PGHDR_DIRTY, PGHDR_DONT_WRITE, PgHdr::pgno, Pager::pInJournal, PgHdr::pPager, sqlite3BitvecCreate(), sqlite3BitvecSet(), SQLITE_NOMEM, SQLITE_OK, Pager::state, and Pager::stmtInUse.
Referenced by btreeCopyFile(), and freePage().
sqlite3_file* sqlite3PagerFile | ( | Pager * | pPager | ) |
Definition at line 3996 of file pager.c.
References Pager::fd.
Referenced by btreeCopyFile(), sqlite3_file_control(), and sqlite3RunVacuum().
const char* sqlite3PagerFilename | ( | Pager * | pPager | ) |
Definition at line 3980 of file pager.c.
References Pager::zFilename.
Referenced by sqlite3BtreeGetFilename(), and sqlite3BtreeOpen().
void* sqlite3PagerGetData | ( | DbPage * | pPg | ) |
Definition at line 4153 of file pager.c.
References Pager::memDb, PgHdr::nRef, PgHdr::pData, and PgHdr::pPager.
Referenced by accessPayload(), btreeCopyFile(), btreePageFromDbPage(), checkList(), ptrmapGet(), ptrmapPut(), releasePage(), sqlite3BtreeGetMeta(), sqlite3BtreeInitPage(), unlockBtreeIfUnused(), and zeroPage().
void* sqlite3PagerGetExtra | ( | DbPage * | pPg | ) |
Definition at line 4162 of file pager.c.
References PgHdr::pExtra, and PgHdr::pPager.
Referenced by btreeCopyFile(), btreePageFromDbPage(), pageReinit(), releasePage(), sqlite3BtreeInitPage(), and zeroPage().
int sqlite3PagerIsreadonly | ( | Pager * | pPager | ) |
Definition at line 3845 of file pager.c.
References Pager::readOnly.
Referenced by sqlite3BtreeOpen().
int sqlite3PagerJournalMode | ( | Pager * | pPager, | |
int | eMode | |||
) |
Definition at line 4204 of file pager.c.
References Pager::journalMode, MEMDB, PAGER_JOURNALMODE_DELETE, PAGER_JOURNALMODE_MEMORY, PAGER_JOURNALMODE_OFF, PAGER_JOURNALMODE_PERSIST, PAGER_JOURNALMODE_QUERY, and PAGER_JOURNALMODE_TRUNCATE.
Referenced by attachFunc(), sqlite3OpenTempDatabase(), and sqlite3Pragma().
const char* sqlite3PagerJournalname | ( | Pager * | pPager | ) |
Definition at line 4010 of file pager.c.
References Pager::zJournal.
Referenced by sqlite3BtreeGetJournalname().
Definition at line 4225 of file pager.c.
References Pager::journalSizeLimit.
Referenced by sqlite3Pragma().
int sqlite3PagerLockingMode | ( | Pager * | pPager, | |
int | eMode | |||
) |
Definition at line 4177 of file pager.c.
References Pager::exclusiveMode, PAGER_LOCKINGMODE_EXCLUSIVE, PAGER_LOCKINGMODE_NORMAL, PAGER_LOCKINGMODE_QUERY, and Pager::tempFile.
Referenced by attachFunc(), openDatabase(), and sqlite3Pragma().
Definition at line 2915 of file pager.c.
References Pager::errCode, PAGER_UNLOCK, Pager::pPCache, sqlite3PcacheFetch(), SQLITE_FULL, SQLITE_OK, and Pager::state.
Referenced by getAndInitPage().
int sqlite3PagerMaxPageCount | ( | Pager * | pPager, | |
int | mxPage | |||
) |
Definition at line 2017 of file pager.c.
References Pager::mxPgno, and sqlite3PagerPagecount().
Referenced by sqlite3BtreeMaxPageCount().
Definition at line 4059 of file pager.c.
References Pager::dbModified, Pager::dirtyCache, PgHdr::flags, IOTRACE, makeDirty(), MEMDB, Pager::needSync, Pager::noSync, PgHdr::nRef, Pager::origDbSize, pager_get_content(), pager_lookup(), PAGERID, PAGERTRACE5, PGHDR_DIRTY, PGHDR_IN_JOURNAL, PGHDR_NEED_SYNC, PgHdr::pgno, Pager::pInJournal, sqlite3BitvecClear(), sqlite3BitvecTest(), sqlite3PagerGet, sqlite3PagerUnref(), sqlite3PcacheMove(), sqlite3PcacheRelease(), and SQLITE_OK.
Referenced by relocatePage().
int sqlite3PagerNosync | ( | Pager * | pPager | ) |
Definition at line 4018 of file pager.c.
References Pager::noSync.
Referenced by sqlite3BtreeSyncDisabled().
int sqlite3PagerOpen | ( | sqlite3_vfs * | pVfs, | |
Pager ** | ppPager, | |||
const char * | zFilename, | |||
int | nExtra, | |||
int | flags, | |||
int | vfsFlags | |||
) |
Definition at line 1732 of file pager.c.
References Pager::fd, FILEHANDLEID, FORCE_ALIGNMENT, IOTRACE, Pager::jfd, sqlite3_vfs::mxPathname, PAGER_EXCLUSIVE, PAGER_JOURNALMODE_MEMORY, PAGER_LOCKINGMODE_EXCLUSIVE, PAGER_LOCKINGMODE_NORMAL, PAGER_NO_READLOCK, PAGER_OMIT_JOURNAL, PAGER_UNLOCK, pagerStress(), PAGERTRACE3, Pager::pPCache, Pager::pTmpSpace, Pager::pVfs, setSectorSize(), sqlite3_free(), sqlite3JournalSize, sqlite3Malloc(), sqlite3MallocZero(), sqlite3MemJournalSize(), sqlite3OsClose(), sqlite3OsDeviceCharacteristics(), sqlite3OsFullPathname(), sqlite3OsOpen(), sqlite3OsSectorSize(), sqlite3PageMalloc(), sqlite3PcacheOpen(), sqlite3PcacheSize(), SQLITE_CANTOPEN, SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT, SQLITE_DEFAULT_PAGE_SIZE, SQLITE_IOCAP_ATOMIC, SQLITE_IOCAP_ATOMIC512, SQLITE_IOCAP_ATOMIC64K, SQLITE_MAX_DEFAULT_PAGE_SIZE, SQLITE_MAX_PAGE_COUNT, SQLITE_NOMEM, SQLITE_OK, SQLITE_OPEN_READONLY, SQLITE_SYNC_NORMAL, Pager::state, Pager::stfd, sqlite3_vfs::szOsFile, Pager::vfsFlags, Pager::zDirectory, Pager::zFilename, and Pager::zJournal.
Referenced by sqlite3BtreeOpen().
static int sqlite3PagerOpentemp | ( | Pager * | pPager, | |
sqlite3_file * | pFile, | |||
int | vfsFlags | |||
) | [static] |
Definition at line 1698 of file pager.c.
References sqlite3_file::pMethods, Pager::pVfs, sqlite3OsOpen(), SQLITE_OK, SQLITE_OPEN_CREATE, SQLITE_OPEN_DELETEONCLOSE, SQLITE_OPEN_EXCLUSIVE, and SQLITE_OPEN_READWRITE.
Referenced by pager_write_pagelist(), and pagerStmtBegin().
int sqlite3PagerPagecount | ( | Pager * | pPager, | |
int * | pnPage | |||
) |
Definition at line 2082 of file pager.c.
References Pager::dbSize, Pager::errCode, Pager::fd, Pager::mxPgno, pager_error(), PAGER_UNLOCK, Pager::pageSize, PENDING_BYTE, sqlite3_file::pMethods, sqlite3OsFileSize(), SQLITE_OK, Pager::state, and Pager::tempFile.
Referenced by hasHotJournal(), lockBtree(), newDatabase(), pager_open_journal(), pagerPagecount(), pagerSharedLock(), sqlite3PagerAcquire(), sqlite3PagerBegin(), sqlite3PagerMaxPageCount(), sqlite3PagerTruncate(), sqlite3PagerWrite(), and sqlite3VdbeExec().
int sqlite3PagerPageRefcount | ( | DbPage * | pPage | ) |
Definition at line 3859 of file pager.c.
References sqlite3PcachePageRefcount().
Referenced by allocateBtreePage(), and pageReinit().
int sqlite3PagerReadFileheader | ( | Pager * | pPager, | |
int | N, | |||
unsigned char * | pDest | |||
) |
Definition at line 2059 of file pager.c.
References Pager::fd, IOTRACE, sqlite3_file::pMethods, sqlite3OsRead(), SQLITE_IOERR_SHORT_READ, SQLITE_OK, and Pager::tempFile.
Referenced by sqlite3BtreeOpen().
int sqlite3PagerRef | ( | DbPage * | pPg | ) |
Definition at line 2261 of file pager.c.
References sqlite3PcacheRef(), and SQLITE_OK.
Referenced by sqlite3BtreeGetTempCursor().
int sqlite3PagerRefcount | ( | Pager * | pPager | ) |
Definition at line 3852 of file pager.c.
References Pager::pPCache, and sqlite3PcacheRefCount().
Referenced by autoVacuumCommit(), sqlite3BtreeIntegrityCheck(), and unlockBtreeIfUnused().
int sqlite3PagerRollback | ( | Pager * | pPager | ) |
Definition at line 3806 of file pager.c.
References Pager::dbSize, Pager::dirtyCache, Pager::errCode, Pager::journalOpen, MEMDB, pager_end_transaction(), pager_error(), PAGER_EXCLUSIVE, pager_playback(), PAGER_RESERVED, PAGERID, PAGERTRACE2, Pager::setMaster, SQLITE_FULL, SQLITE_OK, and Pager::state.
Referenced by autoVacuumCommit(), pagerUnlockAndRollback(), and sqlite3BtreeRollback().
void sqlite3PagerSetBusyhandler | ( | Pager * | pPager, | |
BusyHandler * | pBusyHandler | |||
) |
Definition at line 1952 of file pager.c.
References Pager::pBusyHandler.
Referenced by sqlite3BtreeOpen().
void sqlite3PagerSetCachesize | ( | Pager * | pPager, | |
int | mxPage | |||
) |
Definition at line 1643 of file pager.c.
References Pager::pPCache, and sqlite3PcacheSetCachesize().
Referenced by sqlite3BtreeSetCacheSize().
Definition at line 1972 of file pager.c.
References Pager::dbSize, Pager::errCode, Pager::memDb, pager_reset(), Pager::pageSize, Pager::pPCache, Pager::pTmpSpace, setSectorSize(), sqlite3PageFree(), sqlite3PageMalloc(), sqlite3PcacheRefCount(), sqlite3PcacheSetPageSize(), SQLITE_MAX_PAGE_SIZE, SQLITE_NOMEM, and SQLITE_OK.
Referenced by lockBtree(), readJournalHdr(), sqlite3BtreeOpen(), and sqlite3BtreeSetPageSize().
Definition at line 1963 of file pager.c.
References Pager::xReiniter.
Referenced by sqlite3BtreeOpen().
void sqlite3PagerSetSafetyLevel | ( | Pager * | pPager, | |
int | level, | |||
int | bFullFsync | |||
) |
Definition at line 1674 of file pager.c.
References Pager::fullSync, Pager::needSync, Pager::noSync, SQLITE_SYNC_FULL, SQLITE_SYNC_NORMAL, Pager::sync_flags, and Pager::tempFile.
Referenced by sqlite3BtreeSetSafetyLevel().
int sqlite3PagerStmtBegin | ( | Pager * | pPager | ) |
Definition at line 3937 of file pager.c.
References pagerStmtBegin().
Referenced by pager_open_journal(), and sqlite3BtreeBeginStmt().
int sqlite3PagerStmtCommit | ( | Pager * | pPager | ) |
Definition at line 3946 of file pager.c.
References PAGERID, PAGERTRACE2, Pager::pInStmt, sqlite3BitvecDestroy(), sqlite3IsMemJournal(), sqlite3OsTruncate(), SQLITE_OK, Pager::stfd, Pager::stmtAutoopen, Pager::stmtInUse, and Pager::stmtNRec.
Referenced by pager_end_transaction(), sqlite3BtreeCommitStmt(), and sqlite3PagerStmtRollback().
int sqlite3PagerStmtRollback | ( | Pager * | pPager | ) |
Definition at line 3964 of file pager.c.
References pager_stmt_playback(), PAGERID, PAGERTRACE2, sqlite3PagerStmtCommit(), SQLITE_OK, Pager::stmtAutoopen, and Pager::stmtInUse.
Referenced by sqlite3BtreeRollbackStmt().
int sqlite3PagerSync | ( | Pager * | pPager | ) |
Definition at line 3576 of file pager.c.
References Pager::fd, MEMDB, sqlite3OsSync(), SQLITE_OK, and Pager::sync_flags.
Referenced by btreeCopyFile().
void* sqlite3PagerTempSpace | ( | Pager * | pPager | ) |
Definition at line 2006 of file pager.c.
References Pager::pTmpSpace.
Referenced by defragmentPage().
Definition at line 2178 of file pager.c.
References Pager::dbSize, Pager::errCode, EXCLUSIVE_LOCK, PAGER_SHARED, pager_truncate(), pager_wait_on_lock(), sqlite3PagerPagecount(), SQLITE_OK, Pager::state, and syncJournal().
Referenced by btreeCopyFile(), and sqlite3PagerCommitPhaseOne().
int sqlite3PagerUnref | ( | DbPage * | pPg | ) |
Definition at line 2937 of file pager.c.
References pagerUnlockIfUnused(), PgHdr::pPager, sqlite3PcacheRelease(), and SQLITE_OK.
Referenced by accessPayload(), btreeCopyFile(), btreeCreateTable(), checkList(), clearCell(), pager_incr_changecounter(), ptrmapGet(), ptrmapPut(), releasePage(), sqlite3BtreeGetMeta(), sqlite3BtreeReleaseTempCursor(), sqlite3PagerAcquire(), sqlite3PagerCommitPhaseOne(), sqlite3PagerMovepage(), and sqlite3PagerWrite().
const sqlite3_vfs* sqlite3PagerVfs | ( | Pager * | pPager | ) |
int sqlite3PagerWrite | ( | DbPage * | pDbPage | ) |
Definition at line 3309 of file pager.c.
References Pager::doNotSync, PgHdr::flags, MEMDB, Pager::needSync, Pager::noSync, pager_lookup(), PAGER_MJ_PGNO, pager_write(), Pager::pageSize, PGHDR_NEED_SYNC, PgHdr::pgno, Pager::pInJournal, PgHdr::pPager, Pager::sectorSize, sqlite3BitvecTest(), sqlite3PagerGet, sqlite3PagerPagecount(), sqlite3PagerUnref(), and SQLITE_OK.
Referenced by allocateBtreePage(), autoVacuumCommit(), balance(), balance_nonroot(), btreeCopyFile(), btreeCreateTable(), clearDatabasePage(), copyPayload(), freePage(), incrVacuumStep(), insertCell(), newDatabase(), pager_incr_changecounter(), ptrmapPut(), relocatePage(), sqlite3BtreeDelete(), sqlite3BtreeInsert(), sqlite3BtreeUpdateMeta(), and sqlite3PagerCommitPhaseOne().
static int syncJournal | ( | Pager * | pPager | ) | [static] |
Definition at line 2291 of file pager.c.
References aJournalMagic, Pager::fd, Pager::fullSync, IOTRACE, Pager::jfd, Pager::journalHdr, Pager::journalMode, Pager::journalOpen, Pager::journalStarted, Pager::needSync, Pager::nRec, PAGER_JOURNALMODE_MEMORY, PAGERID, PAGERTRACE2, PGHDR_NEED_SYNC, Pager::pPCache, sqlite3OsDeviceCharacteristics(), sqlite3OsSync(), sqlite3PcacheAssertFlags, sqlite3PcacheClearFlags(), SQLITE_IOCAP_SAFE_APPEND, SQLITE_IOCAP_SEQUENTIAL, SQLITE_OK, SQLITE_SYNC_DATAONLY, SQLITE_SYNC_FULL, Pager::sync_flags, Pager::tempFile, and write32bits().
Referenced by pagerStress(), sqlite3PagerCommitPhaseOne(), and sqlite3PagerTruncate().
static int write32bits | ( | sqlite3_file * | fd, | |
i64 | offset, | |||
u32 | val | |||
) | [static] |
Definition at line 340 of file pager.c.
References put32bits, and sqlite3OsWrite().
Referenced by pager_write(), sqlite3PagerCommitPhaseOne(), syncJournal(), and writeMasterJournal().
static int writeJournalHdr | ( | Pager * | pPager | ) | [static] |
Definition at line 623 of file pager.c.
References aJournalMagic, Pager::cksumInit, Pager::dbSize, Pager::fd, IOTRACE, Pager::jfd, JOURNAL_HDR_SZ, Pager::journalHdr, Pager::journalMode, Pager::journalOff, Pager::noSync, PAGER_JOURNALMODE_MEMORY, Pager::pageSize, sqlite3_file::pMethods, Pager::pTmpSpace, put32bits, Pager::sectorSize, seekJournalHdr(), sqlite3_randomness(), sqlite3OsDeviceCharacteristics(), sqlite3OsWrite(), SQLITE_IOCAP_SAFE_APPEND, SQLITE_OK, and Pager::stmtHdrOff.
Referenced by pager_open_journal(), pagerStress(), and sqlite3PagerBegin().
static int writeMasterJournal | ( | Pager * | pPager, | |
const char * | zMaster | |||
) | [static] |
Definition at line 790 of file pager.c.
References aJournalMagic, Pager::fullSync, Pager::jfd, Pager::journalMode, Pager::journalOff, Pager::needSync, Pager::noSync, PAGER_JOURNALMODE_MEMORY, PAGER_MJ_PGNO, put32bits, seekJournalHdr(), Pager::setMaster, sqlite3OsFileSize(), sqlite3OsTruncate(), sqlite3OsWrite(), SQLITE_OK, and write32bits().
Referenced by sqlite3PagerCommitPhaseOne().
static int zeroJournalHdr | ( | Pager * | pPager, | |
int | doTruncate | |||
) | [static] |
Definition at line 574 of file pager.c.
References IOTRACE, Pager::jfd, Pager::journalOff, Pager::journalSizeLimit, Pager::noSync, sqlite3OsFileSize(), sqlite3OsSync(), sqlite3OsTruncate(), sqlite3OsWrite(), SQLITE_OK, SQLITE_SYNC_DATAONLY, and Pager::sync_flags.
Referenced by pager_end_transaction().
const unsigned char aJournalMagic[] [static] |
{ 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd7, }
Definition at line 261 of file pager.c.
Referenced by readJournalHdr(), readMasterJournal(), sqlite3PagerCommitPhaseOne(), syncJournal(), writeJournalHdr(), and writeMasterJournal().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:01 2011 by Doxygen 1.6.1