1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Avoid the need for a NEVER() from pager_write_pagelist() by passing in

pPager as an extra parameter.

FossilOrigin-Name: b3179379437dbcb1d8e7f1f8f631a3e7df1a5c9a
This commit is contained in:
drh
2010-07-07 14:19:13 +00:00
parent 51538e9d90
commit 146151cd23
3 changed files with 14 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE----- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Hash: SHA1
C Merge\stogether\sthe\saccident\sfork. C Avoid\sthe\sneed\sfor\sa\sNEVER()\sfrom\spager_write_pagelist()\sby\spassing\sin\npPager\sas\san\sextra\sparameter.
D 2010-07-07T14:00:17 D 2010-07-07T14:19:14
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c4270a1cd7cd70a263b7e96a258aa90e9c3618eb F Makefile.in c4270a1cd7cd70a263b7e96a258aa90e9c3618eb
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -159,7 +159,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19 F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
F src/os_unix.c c6112f0ae34f23ae5ca0189a685e084befbdcf26 F src/os_unix.c c6112f0ae34f23ae5ca0189a685e084befbdcf26
F src/os_win.c c4b785547bbdf334f858c863c63177492e306c92 F src/os_win.c c4b785547bbdf334f858c863c63177492e306c92
F src/pager.c 311571e62fe6a039d2a8dddea830981a6052239a F src/pager.c 23e3b0d774cbedf19dc8636088078e921af7f47f
F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c
F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e
F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07 F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07
@@ -834,14 +834,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P ef126e775a02d69a9cab53028513e8799e1b6044 4bfd46f1db41009a1b925d61c6f074b933caa4ec P cdcf08cb18b1e290a4093454bebbd3e7094d6804
R 0c8a529c4c9b7567d05e53b5d178ef4a R a1eb4884db4a3563f67a9bb6eab5fa2c
U drh U drh
Z 02f7d9abcf94e9acc7e188aaa1f39a23 Z b864d9add7808f5e75f10b52efcf8b3d
-----BEGIN PGP SIGNATURE----- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux) Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMNIh1oxKgR168RlERAn8CAJ9lOhOruvcEEpoiChXfr4dyf3+7bQCfR3mM iD8DBQFMNIzloxKgR168RlERAlABAJ4vj1BnAG1oSSgE47MEpROxioLDtwCcClv6
6rdx06TSs03YdLMZBvDwVrU= T5fcShlMyhP1jpxF/VDz3iE=
=y4S/ =Wv86
-----END PGP SIGNATURE----- -----END PGP SIGNATURE-----

View File

@@ -1 +1 @@
cdcf08cb18b1e290a4093454bebbd3e7094d6804 b3179379437dbcb1d8e7f1f8f631a3e7df1a5c9a

View File

@@ -3328,13 +3328,9 @@ static int syncJournal(Pager *pPager){
** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
** be obtained, SQLITE_BUSY is returned. ** be obtained, SQLITE_BUSY is returned.
*/ */
static int pager_write_pagelist(PgHdr *pList){ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
Pager *pPager; /* Pager object */
int rc; /* Return code */ int rc; /* Return code */
if( NEVER(pList==0) ) return SQLITE_OK;
pPager = pList->pPager;
/* At this point there may be either a RESERVED or EXCLUSIVE lock on the /* At this point there may be either a RESERVED or EXCLUSIVE lock on the
** database file. If there is already an EXCLUSIVE lock, the following ** database file. If there is already an EXCLUSIVE lock, the following
** call is a no-op. ** call is a no-op.
@@ -3351,7 +3347,7 @@ static int pager_write_pagelist(PgHdr *pList){
** EXCLUSIVE, it means the database file has been changed and any rollback ** EXCLUSIVE, it means the database file has been changed and any rollback
** will require a journal playback. ** will require a journal playback.
*/ */
assert( !pagerUseWal(pList->pPager) ); assert( !pagerUseWal(pPager) );
assert( pPager->state>=PAGER_RESERVED ); assert( pPager->state>=PAGER_RESERVED );
rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
@@ -3596,7 +3592,7 @@ static int pagerStress(void *p, PgHdr *pPg){
/* Write the contents of the page out to the database file. */ /* Write the contents of the page out to the database file. */
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
rc = pager_write_pagelist(pPg); rc = pager_write_pagelist(pPager, pPg);
} }
} }
@@ -5225,7 +5221,7 @@ int sqlite3PagerCommitPhaseOne(
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
/* Write all dirty pages to the database file. */ /* Write all dirty pages to the database file. */
rc = pager_write_pagelist(sqlite3PcacheDirtyList(pPager->pPCache)); rc = pager_write_pagelist(pPager,sqlite3PcacheDirtyList(pPager->pPCache));
if( rc!=SQLITE_OK ){ if( rc!=SQLITE_OK ){
assert( rc!=SQLITE_IOERR_BLOCKED ); assert( rc!=SQLITE_IOERR_BLOCKED );
goto commit_phase_one_exit; goto commit_phase_one_exit;