On Wed, Dec 7, 2011 at 10:00, Tommi Virtanen
<[email protected]> wrote:
> def crush(pg):
>    all_osds = ['osd.0', 'osd.1', 'osd.2', ...]
>    result = []
>    # size is the number of copies; primary+replicas
>    while len(result) < size:
>        r = get_random_number()

Err I mean pseudorandom, based on pg. So basically "r = pg" there.

>        chosen = all_osds[ r % len(all_osds) ]
>        if chosen in result:
>            # osd can be picked only once
>            continue
>        result.append(chosen)
>    return result
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to