ping

This email may contain confidential and privileged information.  Any 
unauthorized use is prohibited.  If you are not the intended recipient, please 
contact the  sender by reply email and destroy all copies of the original 
message.

From: Howard Kapustein
Sent: Monday, March 9, 2015 10:10 AM
To: 'sqlite-users at mailinglists.sqlite.org'
Subject: NtFlushBuffersFileEx for SQLITE_SYNC_DATAONLY on Windows ?

Has anyone considered supporting SQLITE_SYNC_DATAONLY on Windows using 
NtFlushBuffersFileEx?
http://msdn.microsoft.com/en-us/library/windows/hardware/hh967720(v=vs.85).aspx

>When the SQLITE_SYNC_DATAONLY flag is used, it means that the sync operation
>only needs to flush data to mass storage. Inode information need not be 
>flushed.
Am I missing something in SQLite's expectations? Isn't this just flush the 
file's data/content but not the associated metadata (filesize, etc Windows 
inode-equivalent) i.e. 
NtFlushBuffersFileEx(...,flags=FLUSH_FLAGS_FILE_DATA_ONLY,...)?

It looks like it's just a change in winSync() to replace

  rc = osFlushFileBuffers(pFile->h);
with something like

  IO_STATUS_BLOCK ioStatusBlock;

  ...

  int isDataOnly = (flags&SQLITE_SYNC_DATAONLY);

  ...

  if (isDataOnly)

    rc = osFlushFileBuffers(pFile->h);

  else

    rc = HRESULT_FROM_NT(NtFlushBuffersFileEx(pFile->h, 
FLUSH_FLAGS_FILE_DATA_ONLY, &ioStatusBlock);

Would a new system call be used to optionally support sync-dataonly semantics? 
Or would this be handled via a new compile-time option and #ifdef in winSync?


-          Howard

Reply via email to