Allocation policy application programming interfaces

To make full use of multi-volume support features, VxFS supports allocation policies that allow files or groups of files to be assigned to specified volumes within the volume set.

An allocation policy specifies a list of volumes and the order in which to attempt allocations. A policy can be assigned to a file, file system, or Storage Checkpoint created from a file system. When policies are assigned to objects in the file system, you must specify how the policy maps to both metadata and file data. For example, if a policy is assigned to a single file, the file system must know where to place both the file data and metadata. If no policies are specified, the file system places data randomly.

The allocation policies are defined per file system and are persistent. There is no fixed limit on the number of allocation policy definitions in a file system. Once a policy is assigned, new file allocations are governed by the policy. For files allocated before a policy was defined or assigned or when a policy on a file has been changed, the policy can be enforced, causing the file to be re-allocated to the appropriate volumes. Allocation policies can be inherited by a newly created file from its parent directory. This is accomplished by specifying the FSAP_INHERIT flag when assigning the policy to the parent directory.

Currently, there is no interface for determining where an existing file is currently allocated. However, these APIs can be used to assign and enforce a policy on a file to assure that the blocks are allocated properly.