From 02bf8b45b7a12ec3cb78046c0b15c91a4e0e6d64 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 1 Sep 2015 23:51:53 +0000 Subject: [PATCH] Very minor optimizations in the unix VFS. FossilOrigin-Name: 6db3ff45bc15ece29cb2c7a736e5c6d005dde200 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_unix.c | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 19e81b185f..456085fe45 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Performance\simprovement\sin\ssqlite3VarintLen(). -D 2015-09-01T22:29:07.506 +C Very\sminor\soptimizations\sin\sthe\sunix\sVFS. +D 2015-09-01T23:51:53.351 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -321,7 +321,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c 388c023582b17890f10c980b30ec1922b471753b +F src/os_unix.c 76f493ed71c4154338049dee1bf6e47f69c74a55 F src/os_win.c 40b3af7a47eb1107d0d69e592bec345a3b7b798a F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/pager.c aa916ca28606ccf4b6877dfc2b643ccbca86589f @@ -1380,7 +1380,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 8a80967f849eed002a701235ed7fb406099d566e -R f6fa5fc612cf465d55de62b1cff01312 +P adf9fefb00ae1dbb07a921c6796cb0a9505c6d19 +R 15ed1e546d27e5e6e36f3f7a000cba56 U drh -Z 09ba603411590b2095375d5c2fdf1bdd +Z d46ac269d8c66ccb24de8ee93f61442e diff --git a/manifest.uuid b/manifest.uuid index df0b92fb65..45286f37bb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -adf9fefb00ae1dbb07a921c6796cb0a9505c6d19 \ No newline at end of file +6db3ff45bc15ece29cb2c7a736e5c6d005dde200 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index d7a94ab096..53a4fd31bd 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3146,7 +3146,6 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ TIMER_START; assert( cnt==(cnt&0x1ffff) ); assert( id->h>2 ); - cnt &= 0x1ffff; do{ #if defined(USE_PREAD) got = osPread(id->h, pBuf, cnt, offset); @@ -3363,8 +3362,8 @@ static int unixWrite( } } #endif - - while( amt>0 && (wrote = seekAndWrite(pFile, offset, pBuf, amt))>0 ){ + + while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ amt -= wrote; offset += wrote; pBuf = &((char*)pBuf)[wrote]; @@ -3372,7 +3371,7 @@ static int unixWrite( SimulateIOError(( wrote=(-1), amt=1 )); SimulateDiskfullError(( wrote=0, amt=1 )); - if( amt>0 ){ + if( amt>wrote ){ if( wrote<0 && pFile->lastErrno!=ENOSPC ){ /* lastErrno set by seekAndWrite */ return SQLITE_IOERR_WRITE;