Defining and assigning allocation policies

The following pseudocode provides an example of using the allocation policy APIs to define and assign allocation policies.

To define and assign an allocation policy to reallocate an existing file's data blocks to a specific volume

To create policies that allocate new files under a directory

In this example, the files are under dir1, the metadata is allocated to vol-01, and file data is allocated to vol-02.