diff options
author | Ilya Dryomov <ilya.dryomov@inktank.com> | 2014-03-24 11:12:48 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2014-04-05 00:08:16 -0400 |
commit | 5e8d4d36bf23bb7baf027c479d54395840219928 (patch) | |
tree | 8bb42011ecacd167a03519d4a7fe596476c0bb1e /net/ceph/osdmap.c | |
parent | 8008ab1080c1768b02d232dcfd9e161cd47cc9f7 (diff) |
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: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'net/ceph/osdmap.c')
-rw-r--r-- | net/ceph/osdmap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index df9389ddd56c..20a38a37794c 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
@@ -1597,7 +1597,7 @@ static int raw_to_up_osds(struct ceph_osdmap *osdmap, | |||
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | /* | 1599 | /* |
1600 | * Given up set, apply pg_temp mapping. | 1600 | * Given up set, apply pg_temp and primary_temp mappings. |
1601 | * | 1601 | * |
1602 | * Return acting set length. *primary is set to acting primary osd id, | 1602 | * Return acting set length. *primary is set to acting primary osd id, |
1603 | * or -1 if acting set is empty. | 1603 | * or -1 if acting set is empty. |
@@ -1644,6 +1644,11 @@ static int apply_temps(struct ceph_osdmap *osdmap, | |||
1644 | temp_primary = *primary; | 1644 | temp_primary = *primary; |
1645 | } | 1645 | } |
1646 | 1646 | ||
1647 | /* primary_temp? */ | ||
1648 | pg = __lookup_pg_mapping(&osdmap->primary_temp, pgid); | ||
1649 | if (pg) | ||
1650 | temp_primary = pg->primary_temp.osd; | ||
1651 | |||
1647 | *primary = temp_primary; | 1652 | *primary = temp_primary; |
1648 | return temp_len; | 1653 | return temp_len; |
1649 | } | 1654 | } |