1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

The OsFile under Unix records a pointer back to the pager. This is intended

to be used for an externalized locking patch. (CVS 1821)

FossilOrigin-Name: 511ee6392472d250b542961d1f715cc7453598e6
This commit is contained in:
drh
2004-07-19 22:08:09 +00:00
parent 8d7e24f1d3
commit d5b447d9ac
5 changed files with 12 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
C Remove\sdebugging\scode\sthat\swas\saccidently\sleft\sin\sjoin4.test.\s(CVS\s1819) C The\sOsFile\sunder\sUnix\srecords\sa\spointer\sback\sto\sthe\spager.\s\sThis\sis\sintended\nto\sbe\sused\sfor\san\sexternalized\slocking\spatch.\s(CVS\s1821)
D 2004-07-19T19:28:44 D 2004-07-19T22:08:10
F Makefile.in 77d1219b6563476711a7a962e865979a6f314eb0 F Makefile.in 77d1219b6563476711a7a962e865979a6f314eb0
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -47,11 +47,11 @@ F src/os_mac.c 3d31e26be1411acfb7961033098631b4f3486fdf
F src/os_mac.h 51d2445f47e182ed32d3bd6937f81070c6fd9bd4 F src/os_mac.h 51d2445f47e182ed32d3bd6937f81070c6fd9bd4
F src/os_test.c 6bf10100de2ca199a91fe7ac6474561c8a7166ae F src/os_test.c 6bf10100de2ca199a91fe7ac6474561c8a7166ae
F src/os_test.h 6a26a4978492e4bbdbf385554958418ff02db162 F src/os_test.h 6a26a4978492e4bbdbf385554958418ff02db162
F src/os_unix.c 7dca8d07ac1d6e2b589eda6d536a4d143160a0f3 F src/os_unix.c 4d5cb2f992235b6f3962410cbdbebcc7639f2e09
F src/os_unix.h c3ee271744327d156a9e016dff965adebadffdfb F src/os_unix.h f3097815e041e82e24d92505e1ff61ba24172d13
F src/os_win.c 54181eb73cb4783c4241feca9eaa490768b39008 F src/os_win.c 54181eb73cb4783c4241feca9eaa490768b39008
F src/os_win.h babd4e912967c6b09088cfe38a45e8005a07ba44 F src/os_win.h babd4e912967c6b09088cfe38a45e8005a07ba44
F src/pager.c 5f8cdc92ee9efb5a7849dc8b561b53122b700c78 F src/pager.c 3fb0fa47da302a6de2a613f755d0b637932b27d4
F src/pager.h 269b6cfc114dba0148203446e41dd19f9647dd53 F src/pager.h 269b6cfc114dba0148203446e41dd19f9647dd53
F src/parse.y 51c8e696276c409618e66a4ccf316fcff245506e F src/parse.y 51c8e696276c409618e66a4ccf316fcff245506e
F src/pragma.c 8326df8c400f573eb43004dfb8e53e5102acb3e4 F src/pragma.c 8326df8c400f573eb43004dfb8e53e5102acb3e4
@@ -237,7 +237,7 @@ F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
P 88e4bfa154e33c627ff2abb15cc55a100359d370 P e36e59f02eec166ef2c4e0991c97ceb536e3c3f3
R d88cd5107405fcfcebcca1125e7b6d70 R 9b7606b53371bfe0452850bbb1777322
U drh U drh
Z 3d0bae37423036f70ee3028a9a8cd74b Z 7cbb8827b91ca8a90175a2c38d4fff7e

View File

@@ -1 +1 @@
e36e59f02eec166ef2c4e0991c97ceb536e3c3f3 511ee6392472d250b542961d1f715cc7453598e6

View File

@@ -1073,7 +1073,6 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
*/ */
int sqlite3OsClose(OsFile *id){ int sqlite3OsClose(OsFile *id){
if( !id->isOpen ) return SQLITE_OK; if( !id->isOpen ) return SQLITE_OK;
id->zFilename = 0;
sqlite3OsUnlock(id, NO_LOCK); sqlite3OsUnlock(id, NO_LOCK);
if( id->dirfd>=0 ) close(id->dirfd); if( id->dirfd>=0 ) close(id->dirfd);
id->dirfd = -1; id->dirfd = -1;

View File

@@ -62,10 +62,10 @@
*/ */
typedef struct OsFile OsFile; typedef struct OsFile OsFile;
struct OsFile { struct OsFile {
struct Pager *pPager; /* The pager that owns this OsFile. Might be 0 */
struct openCnt *pOpen; /* Info about all open fd's on this inode */ struct openCnt *pOpen; /* Info about all open fd's on this inode */
struct lockInfo *pLock; /* Info about locks on this inode */ struct lockInfo *pLock; /* Info about locks on this inode */
int h; /* The file descriptor */ int h; /* The file descriptor */
const char *zFilename; /* Name passed to open() */
unsigned char locktype; /* The type of lock held on this fd */ unsigned char locktype; /* The type of lock held on this fd */
unsigned char isOpen; /* True if needs to be closed */ unsigned char isOpen; /* True if needs to be closed */
int dirfd; /* File descriptor for the directory */ int dirfd; /* File descriptor for the directory */

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** another is writing.
** **
** @(#) $Id: pager.c,v 1.149 2004/06/30 11:54:07 danielk1977 Exp $ ** @(#) $Id: pager.c,v 1.150 2004/07/19 22:08:10 drh Exp $
*/ */
#include "os.h" /* Must be first to enable large file support */ #include "os.h" /* Must be first to enable large file support */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -1468,6 +1468,7 @@ int sqlite3pager_open(
sqliteFree(zFullPathname); sqliteFree(zFullPathname);
strcpy(&pPager->zJournal[nameLen], "-journal"); strcpy(&pPager->zJournal[nameLen], "-journal");
pPager->fd = fd; pPager->fd = fd;
pPager->fd.pPager = pPager;
pPager->journalOpen = 0; pPager->journalOpen = 0;
pPager->useJournal = useJournal && !memDb; pPager->useJournal = useJournal && !memDb;
pPager->stmtOpen = 0; pPager->stmtOpen = 0;