From: danielk1977 Date: Fri, 23 Mar 2007 10:08:38 +0000 (+0000) Subject: Add a comment to the OsSectorSize() function. (CVS 3710) X-Git-Tag: version-3.6.10~2460 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3d4c887e0b4105bc7333060d2d843ea8a056a06;p=thirdparty%2Fsqlite.git Add a comment to the OsSectorSize() function. (CVS 3710) FossilOrigin-Name: 0fd9983a98d8d61654f252f1708a4d7232a96b53 --- diff --git a/manifest b/manifest index 5d7d2b99e0..57de99d562 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sos_unix.c,\smake\sa\sdistinction\sbetween\spread()\sand\spread64().\s\sAdd\sa\snew\ncompile-time\smacro\sUSE_PREAD64\sto\sselect\sthe\slatter.\s(CVS\s3709) -D 2007-03-22T15:22:06 +C Add\sa\scomment\sto\sthe\sOsSectorSize()\sfunction.\s(CVS\s3710) +D 2007-03-23T10:08:39 F Makefile.in 1fe3d0b46e40fd684e1e61f8e8056cefed16de9f F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -77,14 +77,14 @@ F src/main.c af8922e0205cf618392de2836c9efad71786d0d6 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/os.c 6df3e9c23eaa982d3e66ef770ad2519de5dd4d97 F src/os.h ec780b3561d0bb887d13f193a1a889872c44a236 -F src/os_common.h aa3ef56941dcaf480b6f055a615674fe4909edbc -F src/os_os2.c 175101ffc2142c3fc7962ed7a171806f28f95363 +F src/os_common.h fdccdbedd7e13ef4cb7f9e33484244a27a6b4c4e +F src/os_os2.c de7e1660c72493e177424dddf5130d70fb711752 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c f6c261661a4b88da679dfb45069a46680d8f18d3 +F src/os_unix.c 4642f23ed0c1ae0f1440db1d2b4231348af69360 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e -F src/os_win.c f3ca3e08167eb3382781b840e787809eccb626dc +F src/os_win.c 1d1d0989b0f235751504292c2f28e81044be0d70 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/pager.c dec2b25851190ab2d5b7d44065fae625c566dda5 F src/pager.h 9f6b5ef42c761deec8a9b1966b32e9a9dc89a631 @@ -437,7 +437,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P b078f09bffee5863d595d281f2ecd14e1c9ec727 -R 9457b72e4d50a7bf046bedc43327a3b4 -U drh -Z 2f03d003f64477a1b374c8414bc90cbd +P 177cd92910d01c97eb3133a59fad417edbb1aa92 +R a47ce4776623e0598aaf36f17e96e9f0 +U danielk1977 +Z 7cc396a55ca909ea4a46a72e6fbe0bfd diff --git a/manifest.uuid b/manifest.uuid index 56654afcff..5909d31080 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -177cd92910d01c97eb3133a59fad417edbb1aa92 \ No newline at end of file +0fd9983a98d8d61654f252f1708a4d7232a96b53 \ No newline at end of file diff --git a/src/os_common.h b/src/os_common.h index 89bdeabe04..3b57fb230d 100644 --- a/src/os_common.h +++ b/src/os_common.h @@ -197,7 +197,4 @@ int sqlite3GenericAllocationSize(void *p){ return 0; } #ifndef PAGER_SECTOR_SIZE # define PAGER_SECTOR_SIZE 512 #endif -static int osGenericSectorSize(OsFile *id){ - return PAGER_SECTOR_SIZE; -} diff --git a/src/os_os2.c b/src/os_os2.c index a2cade29f1..a1ec421822 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -732,6 +732,20 @@ static int os2LockState( OsFile *id ){ return ((os2File*)id)->locktype; } +/* +** Return the sector size in bytes of the underlying block device for +** the specified file. This is almost always 512 bytes, but may be +** larger for some devices. +** +** SQLite code assumes this function cannot fail. It also assumes that +** if two files are created in the same file-system directory (i.e. +** a database and it's journal file) that the sector size will be the +** same for both. +*/ +static int os2SectorSize(OsFile *id){ + return PAGER_SECTOR_SIZE; +} + /* ** This vector defines all the methods that can operate on an OsFile ** for os2. @@ -751,7 +765,7 @@ static const IoMethod sqlite3Os2IoMethod = { os2Unlock, os2LockState, os2CheckReservedLock, - osGenericSectorSize, + os2SectorSize, }; /* diff --git a/src/os_unix.c b/src/os_unix.c index dfbb9338cf..4f722b10d5 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2340,6 +2340,20 @@ static int unixLockState(OsFile *id){ return ((unixFile*)id)->locktype; } +/* +** Return the sector size in bytes of the underlying block device for +** the specified file. This is almost always 512 bytes, but may be +** larger for some devices. +** +** SQLite code assumes this function cannot fail. It also assumes that +** if two files are created in the same file-system directory (i.e. +** a database and it's journal file) that the sector size will be the +** same for both. +*/ +static int unixSectorSize(OsFile *id){ + return PAGER_SECTOR_SIZE; +} + /* ** This vector defines all the methods that can operate on an OsFile ** for unix. @@ -2359,7 +2373,7 @@ static const IoMethod sqlite3UnixIoMethod = { unixUnlock, unixLockState, unixCheckReservedLock, - osGenericSectorSize, + unixSectorSize, }; #ifdef SQLITE_ENABLE_LOCKING_STYLE @@ -2382,7 +2396,7 @@ static const IoMethod sqlite3AFPLockingUnixIoMethod = { afpUnixUnlock, unixLockState, afpUnixCheckReservedLock, - osGenericSectorSize, + unixSectorSize, }; /* @@ -2404,7 +2418,7 @@ static const IoMethod sqlite3FlockLockingUnixIoMethod = { flockUnixUnlock, unixLockState, flockUnixCheckReservedLock, - osGenericSectorSize, + unixSectorSize, }; /* @@ -2426,7 +2440,7 @@ static const IoMethod sqlite3DotlockLockingUnixIoMethod = { dotlockUnixUnlock, unixLockState, dotlockUnixCheckReservedLock, - osGenericSectorSize, + unixSectorSize, }; /* @@ -2448,7 +2462,7 @@ static const IoMethod sqlite3NolockLockingUnixIoMethod = { nolockUnixUnlock, unixLockState, nolockUnixCheckReservedLock, - osGenericSectorSize, + unixSectorSize, }; #endif /* SQLITE_ENABLE_LOCKING_STYLE */ diff --git a/src/os_win.c b/src/os_win.c index bc348bbc30..97354ac22c 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -1454,6 +1454,20 @@ static int winLockState(OsFile *id){ return ((winFile*)id)->locktype; } +/* +** Return the sector size in bytes of the underlying block device for +** the specified file. This is almost always 512 bytes, but may be +** larger for some devices. +** +** SQLite code assumes this function cannot fail. It also assumes that +** if two files are created in the same file-system directory (i.e. +** a database and it's journal file) that the sector size will be the +** same for both. +*/ +static int winSectorSize(OsFile *id){ + return PAGER_SECTOR_SIZE; +} + /* ** This vector defines all the methods that can operate on an OsFile ** for win32. @@ -1473,7 +1487,7 @@ static const IoMethod sqlite3WinIoMethod = { winUnlock, winLockState, winCheckReservedLock, - osGenericSectorSize, + winSectorSize, }; /*