Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
2.1.5.14.1 FileAllocationInformation

2.1.5.14.1 FileAllocationInformation

InputBuffer is of type FILE_ALLOCATION_INFORMATION as described in [MS-FSCC] section 2.4.4.

This operation MUST be failed with STATUS_INVALID_PARAMETER under any of the following conditions:

  • If Open.Stream.StreamType is DirectoryStream.

  • If InputBuffer.AllocationSize is greater than the maximum file size allowed by the object store.<123>

Pseudocode for the operation is as follows:

  • If Open.GrantedAccess does not contain FILE_WRITE_DATA, the operation MUST be failed with STATUS_ACCESS_DENIED.

  • If Open.Stream.Oplock is not empty, the object store MUST check for an oplock break according to the algorithm in section 2.1.4.12, with input values as follows:

    • Open equal to this operation's Open

    • Oplock equal to Open.Stream.Oplock

    • Operation equal to "SET_INFORMATION"

    • OpParams containing a member FileInformationClass containing FileAllocationInformation

  • If the Oplock member of the DirectoryStream in Open.Link.ParentFile.StreamList (hereinafter referred to as ParentOplock) is not empty, the object store MUST check for an oplock break on the parent according to the algorithm in section 2.1.4.12, with input values as follows:

    • Open equal to this operation's Open

    • Oplock equal to ParentOplock

    • Operation equal to "SET_INFORMATION"

    • OpParams containing a member FileInformationClass containing FileAllocationInformation

    • Flags equal to "PARENT_OBJECT"

  • If Open.Stream.IsDeleted is TRUE, the operation SHOULD return STATUS_SUCCESS.

  • Set NewAllocationSize to BlockAlign(InputBuffer.AllocationSize,Open.File.Volume.ClusterSize) as described in section 2.1.4.5.

  • If Open.Stream.AllocationSize is equal to NewAllocationSize, the operation MUST return STATUS_SUCCESS.

  • If the space for NewAllocationSize cannot be reserved in the storage media, then the operation MUST be failed with STATUS_DISK_FULL.

  • Open.Stream.AllocationSize MUST be set to NewAllocationSize.

  • If NewAllocationSize is less than Open.Stream.Size:

    • The object store MUST set Open.Stream.Size to NewAllocationSize, truncating the Stream.

    • The object store MUST post a USN change as per section 2.1.4.11 with File equal to File, Reason equal to USN_REASON_DATA_TRUNCATION, and FileName equal to Open.Link.Name.

    • If the object store supports Open.File.Volume.ClusterRefcount, for each EXTENTS that is removed from Open.Stream.ExtentList as a result of truncation, for each cluster that is being referred to by the EXTENTS being removed, its entry in Open.File.Volume.ClusterRefcount MUST be decremented. If the corresponding cluster's reference count goes to zero, then that cluster MUST also be freed.

  • EndIf

  • If Open.Stream.ValidDataLength is greater than Open.Stream.Size, then the object store MUST set Open.Stream.ValidDataLength to Open.Stream.Size.

  • The object store MUST note that the file has been modified as per section 2.1.4.17 with Open equal to Open.

  • The operation returns STATUS_SUCCESS.

Show:
© 2015 Microsoft