ceph: add possible_max_rank and make the code more readable
authorXiubo Li <xiubli@redhat.com>
Wed, 4 Dec 2019 11:57:39 +0000 (06:57 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jan 2020 15:53:40 +0000 (16:53 +0100)
commitb38c9eb4757d5bac1eb8634a9516ef918fca2525
treee6706d4a886a2be10dc54b7c88c63abb3ea29e6e
parent0eb308531f0776fc87f7a7eb4a8efe943d98ab8c
ceph: add possible_max_rank and make the code more readable

The m_num_mds here is actually the number for MDSs which are in
up:active status, and it will be duplicated to m_num_active_mds,
so remove it.

Add possible_max_rank to the mdsmap struct and this will be
the correctly possible largest rank boundary.

Remove the special case for one mds in __mdsmap_get_random_mds(),
because the validate mds rank may not always be 0.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/debugfs.c
fs/ceph/mds_client.c
fs/ceph/mdsmap.c
include/linux/ceph/mdsmap.h