Lines Matching refs:pgno
104 Pgno pgno; /* The page number for this page */ member
216 Pgno pgno; /* The page number */ member
297 p->pgno, (int)PGHDR_TO_DATA(p), p->nRef in pager_refinfo()
427 static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ in pager_lookup() argument
428 PgHdr *p = pPager->aHash[pager_hash(pgno)]; in pager_lookup()
429 while( p && p->pgno!=pgno ){ in pager_lookup()
516 static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){ in pager_cksum() argument
517 u32 cksum = pPager->cksumInit + pgno; in pager_cksum()
534 rc = read32bits(format, jfd, &pgRec.pgno); in pager_playback_one_page()
544 if( pgRec.pgno==0 ){ in pager_playback_one_page()
547 if( pgRec.pgno>(unsigned)pPager->dbSize ){ in pager_playback_one_page()
553 if( pager_cksum(pPager, pgRec.pgno, pgRec.aData)!=cksum ){ in pager_playback_one_page()
561 pPg = pager_lookup(pPager, pgRec.pgno); in pager_playback_one_page()
562 TRACE2("PLAYBACK %d\n", pgRec.pgno); in pager_playback_one_page()
563 sqliteOsSeek(&pPager->fd, (pgRec.pgno-1)*(off_t)SQLITE_PAGE_SIZE); in pager_playback_one_page()
570 assert( pPg->nRef==0 || pPg->pgno==1 ); in pager_playback_one_page()
575 CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); in pager_playback_one_page()
732 if( (int)pPg->pgno <= pPager->origDbSize ){ in pager_playback()
733 sqliteOsSeek(&pPager->fd, SQLITE_PAGE_SIZE*(off_t)(pPg->pgno-1)); in pager_playback()
735 TRACE2("REFETCH %d\n", pPg->pgno); in pager_playback()
736 CODEC(pPager, zBuf, pPg->pgno, 2); in pager_playback()
1112 return p->pgno; in sqlitepager_pagenumber()
1259 sqliteOsSeek(&pPager->fd, (pList->pgno-1)*(off_t)SQLITE_PAGE_SIZE); in pager_write_pagelist()
1260 CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6); in pager_write_pagelist()
1261 TRACE2("STORE %d\n", pList->pgno); in pager_write_pagelist()
1263 CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 0); in pager_write_pagelist()
1311 int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){ in sqlitepager_get() argument
1318 assert( pgno!=0 ); in sqlitepager_get()
1379 pPg = pager_lookup(pPager, pgno); in sqlitepager_get()
1475 h = pager_hash(pPg->pgno); in sqlitepager_get()
1482 pPg->pgno = pgno; in sqlitepager_get()
1483 if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){ in sqlitepager_get()
1484 sqliteCheckMemory(pPager->aInJournal, pgno/8); in sqlitepager_get()
1486 pPg->inJournal = (pPager->aInJournal[pgno/8] & (1<<(pgno&7)))!=0; in sqlitepager_get()
1492 if( pPager->aInCkpt && (int)pgno<=pPager->ckptSize in sqlitepager_get()
1493 && (pPager->aInCkpt[pgno/8] & (1<<(pgno&7)))!=0 ){ in sqlitepager_get()
1502 h = pager_hash(pgno); in sqlitepager_get()
1518 if( pPager->dbSize<(int)pgno ){ in sqlitepager_get()
1522 sqliteOsSeek(&pPager->fd, (pgno-1)*(off_t)SQLITE_PAGE_SIZE); in sqlitepager_get()
1524 TRACE2("FETCH %d\n", pPg->pgno); in sqlitepager_get()
1525 CODEC(pPager, PGHDR_TO_DATA(pPg), pPg->pgno, 3); in sqlitepager_get()
1529 || fileSize>=pgno*SQLITE_PAGE_SIZE ){ in sqlitepager_get()
1557 void *sqlitepager_lookup(Pager *pPager, Pgno pgno){ in sqlitepager_lookup() argument
1561 assert( pgno!=0 ); in sqlitepager_lookup()
1569 pPg = pager_lookup(pPager, pgno); in sqlitepager_lookup()
1801 if( (int)pPg->pgno <= pPager->origDbSize ){ in sqlitepager_write()
1805 u32 cksum = pager_cksum(pPager, pPg->pgno, pData); in sqlitepager_write()
1812 store32bits(pPg->pgno, pPg, -4); in sqlitepager_write()
1813 CODEC(pPager, pData, pPg->pgno, 7); in sqlitepager_write()
1815 TRACE3("JOURNAL %d %d\n", pPg->pgno, pPg->needSync); in sqlitepager_write()
1816 CODEC(pPager, pData, pPg->pgno, 0); in sqlitepager_write()
1827 pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_write()
1831 pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_write()
1836 TRACE3("APPEND %d %d\n", pPg->pgno, pPg->needSync); in sqlitepager_write()
1848 if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ in sqlitepager_write()
1849 assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); in sqlitepager_write()
1850 store32bits(pPg->pgno, pPg, -4); in sqlitepager_write()
1851 CODEC(pPager, pData, pPg->pgno, 7); in sqlitepager_write()
1853 TRACE2("CKPT-JOURNAL %d\n", pPg->pgno); in sqlitepager_write()
1854 CODEC(pPager, pData, pPg->pgno, 0); in sqlitepager_write()
1862 pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_write()
1868 if( pPager->dbSize<(int)pPg->pgno ){ in sqlitepager_write()
1869 pPager->dbSize = pPg->pgno; in sqlitepager_write()
1888 int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void *pData){ in sqlitepager_overwrite() argument
1892 rc = sqlitepager_get(pPager, pgno, &pPage); in sqlitepager_overwrite()
1927 void sqlitepager_dont_write(Pager *pPager, Pgno pgno){ in sqlitepager_dont_write() argument
1930 pPg = pager_lookup(pPager, pgno); in sqlitepager_dont_write()
1933 if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSize<pPager->dbSize ){ in sqlitepager_dont_write()
1943 TRACE2("DONT_WRITE %d\n", pgno); in sqlitepager_dont_write()
1961 if( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ){ in sqlitepager_dont_rollback()
1963 pPager->aInJournal[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_dont_rollback()
1966 pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_dont_rollback()
1969 TRACE2("DONT_ROLLBACK %d\n", pPg->pgno); in sqlitepager_dont_rollback()
1971 if( pPager->ckptInUse && !pPg->inCkpt && (int)pPg->pgno<=pPager->ckptSize ){ in sqlitepager_dont_rollback()
1972 assert( pPg->inJournal || (int)pPg->pgno>pPager->origDbSize ); in sqlitepager_dont_rollback()
1974 pPager->aInCkpt[pPg->pgno/8] |= 1<<(pPg->pgno&7); in sqlitepager_dont_rollback()
2217 pPg->pgno, (int)PGHDR_TO_DATA(pPg), pPg->nRef); in sqlitepager_refdump()