Minor simplifications to the unix VFS.

FossilOrigin-Name: 2f13c16b45685ec6850cbd9da79e8198bad6a491
This commit is contained in:
drh 2015-12-02 13:11:03 +00:00
parent 2c8fd12f42
commit f3b1ed0fc2
3 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
C Change\sthe\sSQLITE_NO_SYNC\scompile-time\soption\sto\scall\sfstat()\sin\splace\sof\nfsync()\srather\sthan\sbeing\sa\stotal\sno-op. C Minor\ssimplifications\sto\sthe\sunix\sVFS.
D 2015-12-02T02:33:36.549 D 2015-12-02T13:11:03.174
F Makefile.in 23d9a63484a383fc64951b25ef44067930f98dc6 F Makefile.in 23d9a63484a383fc64951b25ef44067930f98dc6
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc e8fdca1cb89a1b58b5f4d3a130ea9a3d28cb314d F Makefile.msc e8fdca1cb89a1b58b5f4d3a130ea9a3d28cb314d
@ -323,7 +323,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c badd3d7b007daa74df6a12c1e5a89a8504ef3594 F src/os_unix.c 2b65298be9db161beb0e3ffadc9be0080d51c320
F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811 F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
F src/pager.c f92aacd5216d8815136c9e0190041783c602641a F src/pager.c f92aacd5216d8815136c9e0190041783c602641a
@ -1408,7 +1408,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 3d02711a709a7e708edb0ea8ca5d17b39dd307f6 P f64ea8a052af9790d5e6987cbd5e81d77da6f172
R 32c34918a379a944fbe8e3ec0a4b5179 R 7335e7d7ad4ea5951ac863300cf3bdc9
U drh U drh
Z d4a14e46436f968eb1bd48b7a43684a4 Z 5e48ed834d343e9f2a57065e0ab37833

View File

@ -1 +1 @@
f64ea8a052af9790d5e6987cbd5e81d77da6f172 2f13c16b45685ec6850cbd9da79e8198bad6a491

View File

@ -4123,7 +4123,7 @@ static int unixShmRegionPerMap(void){
static void unixShmPurge(unixFile *pFd){ static void unixShmPurge(unixFile *pFd){
unixShmNode *p = pFd->pInode->pShmNode; unixShmNode *p = pFd->pInode->pShmNode;
assert( unixMutexHeld() ); assert( unixMutexHeld() );
if( p && p->nRef==0 ){ if( p && ALWAYS(p->nRef==0) ){
int nShmPerMap = unixShmRegionPerMap(); int nShmPerMap = unixShmRegionPerMap();
int i; int i;
assert( p->pInode==pFd->pInode ); assert( p->pInode==pFd->pInode );
@ -4210,7 +4210,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
** a new *-shm file is created, an attempt will be made to create it ** a new *-shm file is created, an attempt will be made to create it
** with the same permissions. ** with the same permissions.
*/ */
if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){ if( osFstat(pDbFd->h, &sStat) ){
rc = SQLITE_IOERR_FSTAT; rc = SQLITE_IOERR_FSTAT;
goto shm_open_err; goto shm_open_err;
} }
@ -4766,17 +4766,13 @@ static void unixRemapfile(
** recreated as a result of outstanding references) or an SQLite error ** recreated as a result of outstanding references) or an SQLite error
** code otherwise. ** code otherwise.
*/ */
static int unixMapfile(unixFile *pFd, i64 nByte){ static int unixMapfile(unixFile *pFd, i64 nMap){
i64 nMap = nByte;
int rc;
assert( nMap>=0 || pFd->nFetchOut==0 ); assert( nMap>=0 || pFd->nFetchOut==0 );
if( pFd->nFetchOut>0 ) return SQLITE_OK; if( pFd->nFetchOut>0 ) return SQLITE_OK;
if( nMap<0 ){ if( nMap<0 ){
struct stat statbuf; /* Low-level file information */ struct stat statbuf; /* Low-level file information */
rc = osFstat(pFd->h, &statbuf); if( osFstat(pFd->h, &statbuf) ){
if( rc!=SQLITE_OK ){
return SQLITE_IOERR_FSTAT; return SQLITE_IOERR_FSTAT;
} }
nMap = statbuf.st_size; nMap = statbuf.st_size;