MCPcopy Create free account
hub / github.com/ceph/ceph / object_may_exist

Method object_may_exist

src/librbd/ObjectMap.cc:87–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86template <typename I>
87bool ObjectMap<I>::object_may_exist(uint64_t object_no) const
88{
89 ceph_assert(ceph_mutex_is_locked(m_image_ctx.image_lock));
90
91 // Fall back to default logic if object map is disabled or invalid
92 if (!m_image_ctx.test_features(RBD_FEATURE_OBJECT_MAP,
93 m_image_ctx.image_lock)) {
94 return true;
95 }
96
97 bool flags_set;
98 int r = m_image_ctx.test_flags(m_image_ctx.snap_id,
99 RBD_FLAG_OBJECT_MAP_INVALID,
100 m_image_ctx.image_lock, &flags_set);
101 if (r < 0 || flags_set) {
102 return true;
103 }
104
105 uint8_t state = (*this)[object_no];
106 bool exists = (state != OBJECT_NONEXISTENT);
107 ldout(m_image_ctx.cct, 20) << "object_no=" << object_no << " r=" << exists
108 << dendl;
109 return exists;
110}
111
112template <typename I>
113bool ObjectMap<I>::update_required(const ceph::BitVector<2>::Iterator& it,

Callers 6

copyFunction · 0.80
sendMethod · 0.80
sendMethod · 0.80
sendMethod · 0.80
read_objectMethod · 0.80
sendMethod · 0.80

Calls 2

test_featuresMethod · 0.80
test_flagsMethod · 0.45

Tested by

no test coverage detected