X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Frgw%2Frgw_lc.h;h=60f3863fc837e942b03a89398e16cb576714b29e;hb=f6b5b4d738b87d88d2de35127b6b0e41eae2a272;hp=57f02a63e81f61f5046b2ddf015d812a93e1628b;hpb=12732ca2e80d168d344a265acffc1fbd1fa1f1b5;p=ceph.git diff --git a/ceph/src/rgw/rgw_lc.h b/ceph/src/rgw/rgw_lc.h index 57f02a63e..60f3863fc 100644 --- a/ceph/src/rgw/rgw_lc.h +++ b/ceph/src/rgw/rgw_lc.h @@ -467,12 +467,18 @@ public: const DoutPrefixProvider *dpp; CephContext *cct; RGWLC *lc; - ceph::mutex lock = ceph::make_mutex("LCWorker"); - ceph::condition_variable cond; + int ix; + std::mutex lock; + std::condition_variable cond; WorkPool* workpool{nullptr}; public: - LCWorker(const DoutPrefixProvider* _dpp, CephContext *_cct, RGWLC *_lc); + + using lock_guard = std::lock_guard; + using unique_lock = std::unique_lock; + + LCWorker(const DoutPrefixProvider* dpp, CephContext *_cct, RGWLC *_lc, + int ix); RGWLC* get_lc() { return lc; } void *entry() override; void stop(); @@ -482,6 +488,7 @@ public: friend class RGWRados; friend class RGWLC; + friend class WorkQ; }; /* LCWorker */ friend class RGWRados; @@ -494,13 +501,18 @@ public: void initialize(CephContext *_cct, rgw::sal::RGWRadosStore *_store); void finalize(); - int process(LCWorker* worker); - int process(int index, int max_secs, LCWorker* worker); - bool if_already_run_today(time_t& start_date); - int list_lc_progress(const string& marker, uint32_t max_entries, map *progress_map); + int process(LCWorker* worker, bool once); + int process(int index, int max_secs, LCWorker* worker, bool once); + bool if_already_run_today(time_t start_date); + bool expired_session(time_t started); + time_t thread_stop_at(); + int list_lc_progress(string& marker, uint32_t max_entries, + vector&, int& index); int bucket_lc_prepare(int index, LCWorker* worker); - int bucket_lc_process(string& shard_id, LCWorker* worker); - int bucket_lc_post(int index, int max_lock_sec, pair& entry, int& result, LCWorker* worker); + int bucket_lc_process(string& shard_id, LCWorker* worker, time_t stop_at, + bool once); + int bucket_lc_post(int index, int max_lock_sec, + cls_rgw_lc_entry& entry, int& result, LCWorker* worker); bool going_down(); void start_processor(); void stop_processor(); @@ -518,7 +530,7 @@ public: int handle_multipart_expiration(RGWRados::Bucket *target, const multimap& prefix_map, - LCWorker* worker); + LCWorker* worker, time_t stop_at, bool once); }; namespace rgw::lc { @@ -533,6 +545,14 @@ std::string s3_expiration_header( const ceph::real_time& mtime, const std::map& bucket_attrs); +bool s3_multipart_abort_header( + DoutPrefixProvider* dpp, + const rgw_obj_key& obj_key, + const ceph::real_time& mtime, + const std::map& bucket_attrs, + ceph::real_time& abort_date, + std::string& rule_id); + } // namespace rgw::lc #endif