Lines Matching refs:osdmap
2427 int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, in ceph_object_locator_to_pg() argument
2434 pi = ceph_pg_pool_by_id(osdmap, oloc->pool); in ceph_object_locator_to_pg()
2515 static void remove_nonexistent_osds(struct ceph_osdmap *osdmap, in remove_nonexistent_osds() argument
2526 if (!ceph_osd_exists(osdmap, set->osds[i])) { in remove_nonexistent_osds()
2537 if (!ceph_osd_exists(osdmap, set->osds[i])) in remove_nonexistent_osds()
2549 static void pg_to_raw_osds(struct ceph_osdmap *osdmap, in pg_to_raw_osds() argument
2563 ruleno = crush_find_rule(osdmap->crush, pi->crush_ruleset, pi->type, in pg_to_raw_osds()
2578 len = do_crush(osdmap, ruleno, pps, raw->osds, pi->size, in pg_to_raw_osds()
2579 osdmap->osd_weight, osdmap->max_osd, pi->id); in pg_to_raw_osds()
2588 remove_nonexistent_osds(osdmap, pi, raw); in pg_to_raw_osds()
2592 static void apply_upmap(struct ceph_osdmap *osdmap, in apply_upmap() argument
2599 pg = lookup_pg_mapping(&osdmap->pg_upmap, pgid); in apply_upmap()
2606 osd < osdmap->max_osd && in apply_upmap()
2607 osdmap->osd_weight[osd] == 0) { in apply_upmap()
2618 pg = lookup_pg_mapping(&osdmap->pg_upmap_items, pgid); in apply_upmap()
2641 to < osdmap->max_osd && in apply_upmap()
2642 osdmap->osd_weight[to] == 0)) { in apply_upmap()
2659 static void raw_to_up_osds(struct ceph_osdmap *osdmap, in raw_to_up_osds() argument
2673 if (ceph_osd_is_down(osdmap, set->osds[i])) { in raw_to_up_osds()
2686 if (ceph_osd_is_down(osdmap, set->osds[i])) in raw_to_up_osds()
2694 static void apply_primary_affinity(struct ceph_osdmap *osdmap, in apply_primary_affinity() argument
2706 if (!osdmap->osd_primary_affinity) in apply_primary_affinity()
2713 osdmap->osd_primary_affinity[osd] != in apply_primary_affinity()
2733 aff = osdmap->osd_primary_affinity[osd]; in apply_primary_affinity()
2770 static void get_temp_osds(struct ceph_osdmap *osdmap, in get_temp_osds() argument
2781 pg = lookup_pg_mapping(&osdmap->pg_temp, pgid); in get_temp_osds()
2784 if (ceph_osd_is_down(osdmap, pg->pg_temp.osds[i])) { in get_temp_osds()
2804 pg = lookup_pg_mapping(&osdmap->primary_temp, pgid); in get_temp_osds()
2816 void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap, in ceph_pg_to_up_acting_osds() argument
2828 pg_to_raw_osds(osdmap, pi, raw_pgid, up, &pps); in ceph_pg_to_up_acting_osds()
2829 apply_upmap(osdmap, &pgid, up); in ceph_pg_to_up_acting_osds()
2830 raw_to_up_osds(osdmap, pi, up); in ceph_pg_to_up_acting_osds()
2831 apply_primary_affinity(osdmap, pi, pps, up); in ceph_pg_to_up_acting_osds()
2832 get_temp_osds(osdmap, pi, &pgid, acting); in ceph_pg_to_up_acting_osds()
2842 bool ceph_pg_to_primary_shard(struct ceph_osdmap *osdmap, in ceph_pg_to_primary_shard() argument
2860 ceph_pg_to_up_acting_osds(osdmap, pi, &pgid, &up, &acting); in ceph_pg_to_primary_shard()
2875 int ceph_pg_to_acting_primary(struct ceph_osdmap *osdmap, in ceph_pg_to_acting_primary() argument
2881 pi = ceph_pg_pool_by_id(osdmap, raw_pgid->pool); in ceph_pg_to_acting_primary()
2885 ceph_pg_to_up_acting_osds(osdmap, pi, raw_pgid, &up, &acting); in ceph_pg_to_acting_primary()
3087 int ceph_get_crush_locality(struct ceph_osdmap *osdmap, int id, in ceph_get_crush_locality() argument
3099 id = get_immediate_parent(osdmap->crush, id, &type_id, &loc); in ceph_get_crush_locality()