aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-03-16 19:10:46 +0000
committerdrh <drh@noemail.net>2016-03-16 19:10:46 +0000
commit3f77389bb4438caeedb5be6f3270e80ec99ed948 (patch)
tree05408864800392900523214e3f471293079d1cc4 /src/os_unix.c
parent892ffcc7fc5b0a6d20c20c64b56096ee8ecbd207 (diff)
parent86151e8905a6767e3c5173dba111ead43ec865ca (diff)
downloadsqlite-3f77389bb4438caeedb5be6f3270e80ec99ed948.tar.gz
sqlite-3f77389bb4438caeedb5be6f3270e80ec99ed948.zip
Avoid a few unnecessary fstat()s on journal files.
FossilOrigin-Name: dbf84705913c0845ca4e75eb30c91536c754efeb
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index d6fbd8058..eb1a63c68 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1357,6 +1357,10 @@ static int fileHasMoved(unixFile *pFile){
static void verifyDbFile(unixFile *pFile){
struct stat buf;
int rc;
+
+ /* These verifications occurs for the main database only */
+ if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return;
+
rc = osFstat(pFile->h, &buf);
if( rc!=0 ){
sqlite3_log(SQLITE_WARNING, "cannot fstat db file %s", pFile->zPath);
@@ -5803,9 +5807,6 @@ static int unixOpen(
p->openFlags = openFlags;
}
#endif
-
- noLock = eType!=SQLITE_OPEN_MAIN_DB;
-
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
if( fstatfs(fd, &fsInfo) == -1 ){
@@ -5824,6 +5825,7 @@ static int unixOpen(
/* Set up appropriate ctrlFlags */
if( isDelete ) ctrlFlags |= UNIXFILE_DELETE;
if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY;
+ noLock = eType!=SQLITE_OPEN_MAIN_DB;
if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK;
if( syncDir ) ctrlFlags |= UNIXFILE_DIRSYNC;
if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI;