sys: maintain FO_FILE_MODIFIED bit

This commit is contained in:
Bill Zissimopoulos 2016-10-29 13:04:13 -07:00
parent 9bcd8dcb8e
commit e0f163e9ba
3 changed files with 15 additions and 1 deletions

View File

@ -896,6 +896,9 @@ static NTSTATUS FspFsvolSetAllocationInformation(PFILE_OBJECT FileObject,
FspFileNodeSetFileInfo(FileNode, FileObject, &Response->Rsp.SetInformation.FileInfo);
FileNode->TruncateOnClose = TRUE;
/* mark the file object as modified */
SetFlag(FileObject->Flags, FO_FILE_MODIFIED);
FspFileNodeNotifyChange(FileNode, FILE_NOTIFY_CHANGE_SIZE, FILE_ACTION_MODIFIED);
}
@ -996,6 +999,9 @@ static NTSTATUS FspFsvolSetEndOfFileInformation(PFILE_OBJECT FileObject,
FspFileNodeSetFileInfo(FileNode, FileObject, &Response->Rsp.SetInformation.FileInfo);
FileNode->TruncateOnClose = TRUE;
/* mark the file object as modified -- FastFat does this only for Allocation though! */
SetFlag(FileObject->Flags, FO_FILE_MODIFIED);
FspFileNodeNotifyChange(FileNode, FILE_NOTIFY_CHANGE_SIZE, FILE_ACTION_MODIFIED);
}

View File

@ -229,6 +229,9 @@ static NTSTATUS FspFsvolWriteCached(
if (SynchronousIo)
FileObject->CurrentByteOffset.QuadPart = WriteEndOffset;
/* mark the file object as modified (if not paging I/O) */
SetFlag(FileObject->Flags, FO_FILE_MODIFIED);
FspFileNodeRelease(FileNode, Main);
return STATUS_SUCCESS;
@ -432,6 +435,10 @@ NTSTATUS FspFsvolWriteComplete(
Response->Rsp.Write.FileInfo.FileSize :
WriteOffset.QuadPart + Response->IoStatus.Information;
/* mark the file object as modified (if not paging I/O) */
if (!PagingIo)
SetFlag(FileObject->Flags, FO_FILE_MODIFIED);
FspIopResetRequest(Request, 0);
}
else

View File

@ -634,7 +634,8 @@ static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
* To properly implement this we should maintain some state of whether
* we modified the file or not. Alternatively we could have the driver
* report to us at Cleanup time whether the file was modified. [The
* driver does not currently maintain the FO_FILE_MODIFIED bit however.]
* FSD does maintain the FO_FILE_MODIFIED bit, but does not send it
* to us.]
*
* TBD.
*/