libceph: crush_location infrastructure

Allow expressing client's location in terms of CRUSH hierarchy as
a set of (bucket type name, bucket name) pairs.  The userspace syntax
"crush_location = key1=value1 key2=value2" is incompatible with mount
options and needed adaptation.  Key-value pairs are separated by '|'
and we use ':' instead of '=' to separate keys from values.  So for:

  crush_location = host=foo rack=bar

one would write:

  crush_location=host:foo|rack:bar

As in userspace, "multipath" locations are supported, so indicating
locality for parallel hierarchies is possible:

  crush_location=rack:foo1|rack:foo2|datacenter:bar

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
This commit is contained in:
Ilya Dryomov
2020-05-22 15:24:53 +02:00
parent 86403a92c3
commit 45e6aa9f55
4 changed files with 168 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ struct ceph_options {
int num_mon;
char *name;
struct ceph_crypto_key *key;
struct rb_root crush_locs;
};
/*