Compartilhar via


2.1.5.7 Server Requests Flushing Cached Data

The server provides:

  • Open: An Open of a DataFile or DirectoryFile for which it is to flush cached data.

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

The object store MUST flush all persistent attributes for Open.File to stable storage. In addition:

  • If Open.File.Volume.IsReadOnly is TRUE, the operation MUST be failed with STATUS_MEDIA_WRITE_PROTECTED.

  • The operation MUST be failed with the status code returned from the underlying physical storage. The operation flushes all eligible objects; however, only the first failure encountered is returned.

  • The operation ensures that the directory structure is persisted to stable storage.<80>

Pseudocode for the operation is as follows:

  • If Open.Stream.StreamType is DataStream:

    • Flush cached data of Open.File

    • Flush file system metadata associated with Open.File.

  • Else if Open.Stream.StreamType is DirectoryStream:

    • Flush file system metadata associated with Open.File

  • Else if Open.File is equal to Open.File.Volume.RootDirectory:

    • For each OpenFile in Open.File.Volume.OpenFileList:

      • Flush OpenFile

      • Flush file system metadata associated with OpenFile

    • EndFor

  • EndIf

  • Flush the underlying physical storage.