'Set various GPFS attributes for this volume.'

def _set_volume_attributes(self, volume, path, metadata):

    set_pool = False
    options = []
    for item in metadata:
        if (item == 'data_pool_name'):
            options.extend(['-P', metadata[item]])
            set_pool = True
        elif (item == 'replicas'):
            options.extend(['-r', metadata[item], '-m', metadata[item]])
        elif (item == 'dio'):
            options.extend(['-D', metadata[item]])
        elif (item == 'write_affinity_depth'):
            options.extend(['--write-affinity-depth', metadata[item]])
        elif (item == 'block_group_factor'):
            options.extend(['--block-group-factor', metadata[item]])
        elif (item == 'write_affinity_failure_group'):
            options.extend(['--write-affinity-failure-group', metadata[item]])
    if (self.configuration.gpfs_storage_pool and (not set_pool)):
        options.extend(['-P', self.configuration.gpfs_storage_pool])
    if options:
        self._gpfs_change_attributes(options, path)
    fstype = None
    fslabel = None
    for item in metadata:
        if (item == 'fstype'):
            fstype = metadata[item]
        elif (item == 'fslabel'):
            fslabel = metadata[item]
    if fstype:
        self._mkfs(volume, fstype, fslabel)
