X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Frgw%2Frgw_metadata.cc;h=6c554810e98a81b181503bc0b81e2aa85609a84f;hb=181888fb293938ba79f4c96c14bf1459f38d18af;hp=f81c4490ae82160d605346f72706b1e05145a824;hpb=36f6c5ea099d43087ff0276121fd34e71668ae0e;p=ceph.git diff --git a/ceph/src/rgw/rgw_metadata.cc b/ceph/src/rgw/rgw_metadata.cc index f81c4490a..6c554810e 100644 --- a/ceph/src/rgw/rgw_metadata.cc +++ b/ceph/src/rgw/rgw_metadata.cc @@ -273,8 +273,8 @@ obj_version& RGWMetadataObject::get_version() class RGWMetadataTopHandler : public RGWMetadataHandler { struct iter_data { - list sections; - list::iterator iter; + set sections; + set::iterator iter; }; public: @@ -290,10 +290,14 @@ public: int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) override { return -ENOTSUP; } - int list_keys_init(RGWRados *store, void **phandle) override { + int list_keys_init(RGWRados *store, const string& marker, void **phandle) override { iter_data *data = new iter_data; - store->meta_mgr->get_sections(data->sections); - data->iter = data->sections.begin(); + list sections; + store->meta_mgr->get_sections(sections); + for (auto& s : sections) { + data->sections.insert(s); + } + data->iter = data->sections.lower_bound(marker); *phandle = data; @@ -314,6 +318,16 @@ public: delete data; } + + virtual string get_marker(void *handle) { + iter_data *data = static_cast(handle); + + if (data->iter != data->sections.end()) { + return *(data->iter); + } + + return string(); + } }; static RGWMetadataTopHandler md_top_handler; @@ -830,8 +844,12 @@ struct list_keys_handle { RGWMetadataHandler *handler; }; - int RGWMetadataManager::list_keys_init(string& section, void **handle) +{ + return list_keys_init(section, string(), handle); +} + +int RGWMetadataManager::list_keys_init(string& section, const string& marker, void **handle) { string entry; RGWMetadataHandler *handler; @@ -845,7 +863,7 @@ int RGWMetadataManager::list_keys_init(string& section, void **handle) list_keys_handle *h = new list_keys_handle; h->handler = handler; - ret = handler->list_keys_init(store, &h->handle); + ret = handler->list_keys_init(store, marker, &h->handle); if (ret < 0) { delete h; return ret; @@ -865,7 +883,6 @@ int RGWMetadataManager::list_keys_next(void *handle, int max, list& keys return handler->list_keys_next(h->handle, max, keys, truncated); } - void RGWMetadataManager::list_keys_complete(void *handle) { list_keys_handle *h = static_cast(handle); @@ -876,6 +893,13 @@ void RGWMetadataManager::list_keys_complete(void *handle) delete h; } +string RGWMetadataManager::get_marker(void *handle) +{ + list_keys_handle *h = static_cast(handle); + + return h->handler->get_marker(h->handle); +} + void RGWMetadataManager::dump_log_entry(cls_log_entry& entry, Formatter *f) { f->open_object_section("entry");