libceph: decode CRUSH device/bucket types and names

These would be matched with the provided client location to calculate
the locality value.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
This commit is contained in:
Ilya Dryomov
2020-05-19 17:09:52 +02:00
parent 8a4b863c87
commit 86403a92c3
3 changed files with 97 additions and 3 deletions

View File

@@ -301,6 +301,12 @@ struct crush_map {
__u32 *choose_tries;
#else
/* device/bucket type id -> type name (CrushWrapper::type_map) */
struct rb_root type_names;
/* device/bucket id -> name (CrushWrapper::name_map) */
struct rb_root names;
/* CrushWrapper::choose_args */
struct rb_root choose_args;
#endif
@@ -342,4 +348,10 @@ struct crush_work {
struct crush_work_bucket **work; /* Per-bucket working store */
};
#ifdef __KERNEL__
/* osdmap.c */
void clear_crush_names(struct rb_root *root);
void clear_choose_args(struct crush_map *c);
#endif
#endif