diff options
author | drh <drh@noemail.net> | 2011-08-29 11:56:14 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-08-29 11:56:14 +0000 |
commit | 2f7820d8b57b6d15da7cd82239e14aafde1ca386 (patch) | |
tree | aee10a8123873af5fe3bd2632d966d97420f3001 /src/os_unix.c | |
parent | d4b708f6717e999e0559284f39d0086d3bf7a74f (diff) | |
parent | 5d22e41f2d0aaa5c824c62c4cfb498de6e2ac2f2 (diff) | |
download | sqlite-2f7820d8b57b6d15da7cd82239e14aafde1ca386.tar.gz sqlite-2f7820d8b57b6d15da7cd82239e14aafde1ca386.zip |
Back out [05c9832e5f6eb] since it was causing a performance regression with
no obvious benefit.
FossilOrigin-Name: 639cc85a911454bffdcccb33f2976c683953ae64
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 446c6c5fb..8abef8de8 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3445,19 +3445,13 @@ static int proxyFileControl(sqlite3_file*,int,void*); ** nBytes or larger, this routine is a no-op. */ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ - { /* preserve indentation of removed "if" */ + if( pFile->szChunk ){ i64 nSize; /* Required file size */ - i64 szChunk; /* Chunk size */ struct stat buf; /* Used to hold return values of fstat() */ if( osFstat(pFile->h, &buf) ) return SQLITE_IOERR_FSTAT; - szChunk = pFile->szChunk; - if( szChunk==0 ){ - nSize = nByte; - }else{ - nSize = ((nByte+szChunk-1) / szChunk) * szChunk; - } + nSize = ((nByte+pFile->szChunk-1) / pFile->szChunk) * pFile->szChunk; if( nSize>(i64)buf.st_size ){ #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE |