Bug 1878311: Sync obfsDeviceCharacteristics method with sqlite obfsvfs.c.r=dom-storage-reviewers,janv

This change seeks to sync the changes in sqlite's obfsvfs.c, specifically in method obfsDeviceCharacteristics.
This fixes the issue where SQLITE_DIRECT_OVEFLOW_READ option was causing issues for non-standard VFSes. Sqlite
has fixed this issue in 3.47.1 release by introducing SQLITE_IOCAP_SUBPAGE_READ flag, which allows VFS to
signal that it cannot handle unaligned reads.

Differential Revision: https://phabricator.services.mozilla.com/D230671
This commit is contained in:
Harveer Singh
2024-12-03 17:51:00 +00:00
parent e754ad4fcc
commit 1bf4d0347b

View File

@@ -445,8 +445,11 @@ static int obfsSectorSize(sqlite3_file* pFile) {
** Return the device characteristic flags supported by an obfuscated file.
*/
static int obfsDeviceCharacteristics(sqlite3_file* pFile) {
int dc;
pFile = ORIGFILE(pFile);
return pFile->pMethods->xDeviceCharacteristics(pFile);
dc = pFile->pMethods->xDeviceCharacteristics(pFile);
return dc & ~SQLITE_IOCAP_SUBPAGE_READ; /* All except the
SQLITE_IOCAP_SUBPAGE_READ bit */
}
/* Create a shared memory file mapping */