diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2016-04-28 10:07:22 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-05-25 18:36:25 -0400 |
commit | 6f3bfd45cd233eea0b07e3cabc0386b5de9321d2 (patch) | |
tree | cda9593b00d971b10ebeb9279ad1893978236df8 /include/linux/ceph | |
parent | d9591f5e28686277d9312d3c7422faf1368b305e (diff) |
libceph: ceph_osds, ceph_pg_to_up_acting_osds()
Knowning just acting set isn't enough, we need to be able to record up
set as well to detect interval changes. This means returning (up[],
up_len, up_primary, acting[], acting_len, acting_primary) and passing
it around. Introduce and switch to ceph_osds to help with that.
Rename ceph_calc_pg_acting() to ceph_pg_to_up_acting_osds() and return
both up and acting sets from it.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r-- | include/linux/ceph/osdmap.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index b70440c05b49..942189d311e0 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
@@ -208,6 +208,20 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
208 | struct ceph_osdmap *map); | 208 | struct ceph_osdmap *map); |
209 | extern void ceph_osdmap_destroy(struct ceph_osdmap *map); | 209 | extern void ceph_osdmap_destroy(struct ceph_osdmap *map); |
210 | 210 | ||
211 | struct ceph_osds { | ||
212 | int osds[CEPH_PG_MAX_SIZE]; | ||
213 | int size; | ||
214 | int primary; /* id, NOT index */ | ||
215 | }; | ||
216 | |||
217 | static inline void ceph_osds_init(struct ceph_osds *set) | ||
218 | { | ||
219 | set->size = 0; | ||
220 | set->primary = -1; | ||
221 | } | ||
222 | |||
223 | void ceph_osds_copy(struct ceph_osds *dest, const struct ceph_osds *src); | ||
224 | |||
211 | /* calculate mapping of a file extent to an object */ | 225 | /* calculate mapping of a file extent to an object */ |
212 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, | 226 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, |
213 | u64 off, u64 len, | 227 | u64 off, u64 len, |
@@ -218,9 +232,10 @@ int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, | |||
218 | struct ceph_object_locator *oloc, | 232 | struct ceph_object_locator *oloc, |
219 | struct ceph_pg *raw_pgid); | 233 | struct ceph_pg *raw_pgid); |
220 | 234 | ||
221 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, | 235 | void ceph_pg_to_up_acting_osds(struct ceph_osdmap *osdmap, |
222 | struct ceph_pg pgid, | 236 | const struct ceph_pg *raw_pgid, |
223 | int *osds, int *primary); | 237 | struct ceph_osds *up, |
238 | struct ceph_osds *acting); | ||
224 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, | 239 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, |
225 | struct ceph_pg pgid); | 240 | struct ceph_pg pgid); |
226 | 241 | ||