2.1.4.11 Algorithm for Posting a USN Change for a File

The inputs for this algorithm are:

  • File: The file this change occurs on.

  • Reason: A 32-bit unsigned integer describing the change that occurred to the file, as specified in [MS-FSCC] section 2.3.62.

  • FileName: The pathname, relative to Volume.RootDirectory, of the file this change occurs on.

The algorithm MUST return at this point without taking any actions under any of the following conditions:

  • If the object store does not support USN change journals.

  • If File.Volume.IsUsnJournalActive is FALSE.

  • If Reason is zero.

Pseudocode for the algorithm is as follows:

  • Set FileNameLength to the length, in bytes, of FileName.

  • Set RecordLength to an implementation-specific<41> value representing the number of bytes needed to persist the USN change to the store.

  • Set File.Volume.LastUsn to File.Volume.LastUsn + RecordLength.

  • Set File.Usn to File.Volume.LastUsn.