summaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2014-03-24 17:12:48 +0200
committerSage Weil <sage@inktank.com>2014-04-04 21:08:16 -0700
commit5e8d4d36bf23bb7baf027c479d54395840219928 (patch)
tree8bb42011ecacd167a03519d4a7fe596476c0bb1e /net/ceph
parent8008ab1080c1768b02d232dcfd9e161cd47cc9f7 (diff)
downloadlinux-5e8d4d36bf23bb7baf027c479d54395840219928.tar.gz
linux-5e8d4d36bf23bb7baf027c479d54395840219928.tar.bz2
linux-5e8d4d36bf23bb7baf027c479d54395840219928.zip
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')
-rw-r--r--net/ceph/osdmap.c7
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,
}
/*
- * 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;
}