libceph: crush_location infrastructure
authorIlya Dryomov <idryomov@gmail.com>
Fri, 22 May 2020 13:24:53 +0000 (15:24 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 1 Jun 2020 11:22:53 +0000 (13:22 +0200)
commit45e6aa9f5592cd127367074f4822039cd8a825c3
treec76d86a35c3aa9b67112060635093369d20b577c
parent86403a92c3c5c6c395983fdbfc5e2f29dc39279b
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>
include/linux/ceph/libceph.h
include/linux/ceph/osdmap.h
net/ceph/ceph_common.c
net/ceph/osdmap.c