// and insert a new tuple corresponding to the new location of the object. The
// cleaner can now identify live objects within the zone <zone_num> by
// enumerating all the keys starting with <zone_num> prefix.
-void BlueStore::zoned_update_cleaning_metadata(TransContext *txc) {
+void BlueStore::_zoned_update_cleaning_metadata(TransContext *txc) {
for (const auto &[o, offsets] : txc->zoned_onode_to_offset_map) {
std::string key;
get_object_key(cct, o->oid, &key);
if (offset > 0) {
bufferlist offset_bl;
encode(offset, offset_bl);
- txc->t->set(zoned_get_prefix(offset), key, offset_bl);
+ txc->t->set(_zoned_get_prefix(offset), key, offset_bl);
} else {
- txc->t->rmkey(zoned_get_prefix(-offset), key);
+ txc->t->rmkey(_zoned_get_prefix(-offset), key);
}
}
}
}
-std::string BlueStore::zoned_get_prefix(uint64_t offset) {
+std::string BlueStore::_zoned_get_prefix(uint64_t offset) {
uint64_t zone_num = offset / bdev->get_zone_size();
std::string zone_key;
_key_encode_u64(zone_num, &zone_key);
}
if (bdev->is_smr()) {
- zoned_update_cleaning_metadata(txc);
+ _zoned_update_cleaning_metadata(txc);
}
_txc_update_store_statfs(txc);
// are laid out contiguously on disk, which is not the case in general.
// Also, it should always be called after calling extent_map.fault_range(),
// so that the extent map is loaded.
- int64_t get_ondisk_starting_offset() const {
+ int64_t zoned_get_ondisk_starting_offset() const {
return extent_map.extent_map.begin()->blob->
get_blob().calc_offset(0, nullptr);
}
void zoned_note_new_object(OnodeRef &o) {
auto [_, ok] = zoned_onode_to_offset_map.emplace(
- std::pair<OnodeRef, std::vector<int64_t>>(o, {o->get_ondisk_starting_offset()}));
+ std::pair<OnodeRef, std::vector<int64_t>>(o, {o->zoned_get_ondisk_starting_offset()}));
ceph_assert(ok);
}
void zoned_note_updated_object(OnodeRef &o, int64_t prev_offset) {
- int64_t new_offset = o->get_ondisk_starting_offset();
+ int64_t new_offset = o->zoned_get_ondisk_starting_offset();
auto [it, ok] = zoned_onode_to_offset_map.emplace(
std::pair<OnodeRef, std::vector<int64_t>>(o, {-prev_offset, new_offset}));
if (!ok) {
// Functions related to zoned storage.
uint64_t _zoned_piggyback_device_parameters_onto(uint64_t min_alloc_size);
int _zoned_check_config_settings();
+ void _zoned_update_cleaning_metadata(TransContext *txc);
+ std::string _zoned_get_prefix(uint64_t offset);
public:
utime_t get_deferred_last_submitted() {
void _fsck_check_objects(FSCKDepth depth,
FSCK_ObjectCtx& ctx);
-
- // Zoned storage related stuff
- void zoned_update_cleaning_metadata(TransContext *txc);
- std::string zoned_get_prefix(uint64_t offset);
};
inline std::ostream& operator<<(std::ostream& out, const BlueStore::volatile_statfs& s) {