'Delete files from disk till bytes are freed or list exhausted.'

def _delete_files_till_bytes_free(self, file_list, share, bytes_to_free=0):

    LOG.debug('Bytes    to    free    %s', bytes_to_free)
    if (file_list and (bytes_to_free > 0)):
        sorted_files = sorted(file_list, key=(lambda x: x[1]), reverse=True)
        mount_fs = self._get_mount_point_for_share(share)
        for f in sorted_files:
            if f:
                file_path = ('%s/%s' % (mount_fs, f[0]))
                LOG.debug('Delete    file    path    %s', file_path)
                @utils.synchronized(f[0], external=True)
                def _do_delete():
                    if self._delete_file_at_path(file_path):
                        return True
                    return False
                if _do_delete():
                    bytes_to_free -= int(f[1])
                    if (bytes_to_free <= 0):
                        return
