aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-06-21 11:27:18 -0400
committerIlya Dryomov <idryomov@gmail.com>2017-07-07 11:25:18 -0400
commit6f428df47dae2c8ea31fd4c0c74a12a8a5ac2d1d (patch)
tree00076a72eda7738433726f6e6bc4ce1644d370f6 /include/linux/ceph
parent278b1d709c6acc6f7d138fed775c76695b068e43 (diff)
libceph: pg_upmap[_items] infrastructure
pg_temp and pg_upmap encodings are the same (PG -> array of osds), except for the incremental remove: it's an empty mapping in new_pg_temp for pg_temp and a separate old_pg_upmap set for pg_upmap. (This isn't to allow for empty pg_upmap mappings -- apparently, pg_temp just wasn't looked at as an example for pg_upmap encoding.) Reuse __decode_pg_temp() for decoding pg_upmap and new_pg_upmap. __decode_pg_temp() stores into pg_temp union member, but since pg_upmap union member is identical, reading through pg_upmap later is OK. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osdmap.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index fe6d189bdd30..c612cff81f5c 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -143,10 +143,14 @@ struct ceph_pg_mapping {
143 struct { 143 struct {
144 int len; 144 int len;
145 int osds[]; 145 int osds[];
146 } pg_temp; 146 } pg_temp, pg_upmap;
147 struct { 147 struct {
148 int osd; 148 int osd;
149 } primary_temp; 149 } primary_temp;
150 struct {
151 int len;
152 int from_to[][2];
153 } pg_upmap_items;
150 }; 154 };
151}; 155};
152 156
@@ -165,6 +169,10 @@ struct ceph_osdmap {
165 struct rb_root pg_temp; 169 struct rb_root pg_temp;
166 struct rb_root primary_temp; 170 struct rb_root primary_temp;
167 171
172 /* remap (post-CRUSH, pre-up) */
173 struct rb_root pg_upmap; /* PG := raw set */
174 struct rb_root pg_upmap_items; /* from -> to within raw set */
175
168 u32 *osd_primary_affinity; 176 u32 *osd_primary_affinity;
169 177
170 struct rb_root pg_pools; 178 struct rb_root pg_pools;