A method for priority-based allocation in a storage pool involves
receiving a request to write a data item in the storage pool, where the
storage pool includes multiple metaslabs, and where each of the metaslabs
includes a contiguous region of data. The method further involves
determining a target metaslab selected from the multiple metaslabs by
comparing multiple allocation priorities, where each of the allocation
priorities is associated with one of the metaslabs, allocating a block to
the target metaslab, and writing the block to the target metaslab, where
the block includes a portion of the data item.