2.1.5.10.7 FSCTL_FILESYSTEM_GET_STATISTICS

The server provides:

  • Open: An Open of a DataFile or DirectoryFile.

  • OutputBufferSize: The maximum number of bytes to return in OutputBuffer.

On completion, the object store MUST return:

  • Status: An NTSTATUS code that specifies the result.

  • OutputBuffer: An array of bytes that will return an array of statistical data, one entry per (logical or physical) host processor.

  • BytesReturned: The number of bytes returned in OutputBuffer.

This operation also uses the following local variables:

  • An array of bytes (initially empty): FileSystemStatistics.

Support for this operation is optional. If the object store does not implement this functionality, the operation MUST be failed with STATUS_INVALID_DEVICE_REQUEST.<88>

Pseudocode for the operation is as follows:

  • If OutputBufferSize is less than sizeof(FILESYSTEM_STATISTICS), the operation is failed with STATUS_BUFFER_TOO_SMALL.

  • If OutputBufferSize is less than the total size of statistics information, then only OutputBufferSize bytes will be returned, and the operation MUST succeed but return with STATUS_BUFFER_OVERFLOW.

  • For each host processor, add one entry to FileSystemStatistics as follows:

    • FILESYSTEM_STATISTICS structure as specified in [MS-FSCC] section 2.3.12.1.

    • An optional file system-specific structure as specified in [MS-FSCC] section 2.3.12.2.<89>

    • Padding bytes of zeros to bring total size of each entry to be a multiple of 64 bytes.

  • EndFor

  • If OutputBufferSize is less than the total size of FileSystemStatistics, the object store MUST:

    • Copy OutputBufferSize bytes from FileSystemStatistics to OutputBuffer.

    • Set BytesReturned to the number of bytes copied to OutputBuffer.

    • Return Status set to STATUS_BUFFER_OVERFLOW.

  • EndIf

Upon successful completion of the operation, the object store MUST return:

  • Copy FileSystemStatistics to OutputBuffer.

  • Set BytesReturned to the number of bytes copied to OutputBuffer.

  • Return Status set to STATUS_SUCCESS.