Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e8d4d36 authored by Ilya Dryomov's avatar Ilya Dryomov Committed by Sage Weil
Browse files

libceph: add support for primary_temp mappings



Change apply_temp() to override primary in the same way pg_temp
overrides osd set.  primary_temp overrides pg_temp primary too.

Signed-off-by: default avatarIlya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent 8008ab10
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1597,7 +1597,7 @@ static int raw_to_up_osds(struct ceph_osdmap *osdmap,
}

/*
 * Given up set, apply pg_temp mapping.
 * Given up set, apply pg_temp and primary_temp mappings.
 *
 * Return acting set length.  *primary is set to acting primary osd id,
 * or -1 if acting set is empty.
@@ -1644,6 +1644,11 @@ static int apply_temps(struct ceph_osdmap *osdmap,
		temp_primary = *primary;
	}

	/* primary_temp? */
	pg = __lookup_pg_mapping(&osdmap->primary_temp, pgid);
	if (pg)
		temp_primary = pg->primary_temp.osd;

	*primary = temp_primary;
	return temp_len;
}