From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luis Henriques Subject: [RFC PATCH v2 2/4] ceph: get the require_osd_release field from the osdmap Date: Thu, 14 Nov 2019 10:57:34 +0000 Message-ID: <20191114105736.8636-3-lhenriques@suse.com> References: <20191114105736.8636-1-lhenriques@suse.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20191114105736.8636-1-lhenriques@suse.com> Sender: linux-kernel-owner@vger.kernel.org To: Jeff Layton , Sage Weil , Ilya Dryomov , "Yan, Zheng" Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Henriques List-Id: ceph-devel.vger.kernel.org Since Ceph Octopus, OSDs are encoding require_osd_release into the client data part of the osdmap. This patch adds code to pick this extra field. Signed-off-by: Luis Henriques --- include/linux/ceph/ceph_features.h | 10 ++++++++-- include/linux/ceph/osdmap.h | 1 + net/ceph/osdmap.c | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 39e6f4c57580..f329d1907dd7 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h @@ -9,6 +9,7 @@ */ #define CEPH_FEATURE_INCARNATION_1 (0ull) #define CEPH_FEATURE_INCARNATION_2 (1ull<<57) // CEPH_FEATURE_SERVER_JEWEL +#define CEPH_FEATURE_INCARNATION_3 ((1ull<<57)|(1ull<<28)) // SERVER_MIMIC #define DEFINE_CEPH_FEATURE(bit, incarnation, name) \ static const uint64_t CEPH_FEATURE_##name = (1ULL<pg_upmap_items)); } + if (struct_v >= 6) + /* crush version */ + ceph_decode_skip_32(p, end, e_inval); + if (struct_v >= 7) { + /* + * skip removed_snaps and purged_snaps + * (snap_interval_set_t = 8 + 8) + */ + ceph_decode_skip_set(p, end, 16, e_inval); + ceph_decode_skip_set(p, end, 16, e_inval); + } + if (struct_v >= 9) { + struct ceph_timespec ts; + + /* last_up_change and last_in_change */ + ceph_decode_copy_safe(p, end, &ts, sizeof(ts), e_inval); + ceph_decode_copy_safe(p, end, &ts, sizeof(ts), e_inval); + } + if (struct_v >= 10) + ceph_decode_8_safe(p, end, map->require_osd_release, e_inval); + /* ignore the rest */ *p = end;