return ctx.wait();
}
+void JournalTrimmer::remove_objects(bool force, Context *on_finish) {
+ ldout(m_cct, 20) << __func__ << dendl;
+
+ on_finish = new FunctionContext([this, force, on_finish](int r) {
+ Mutex::Locker locker(m_lock);
+
+ if (m_remove_set_pending) {
+ on_finish->complete(-EBUSY);
+ }
+
+ if (!force) {
+ JournalMetadata::RegisteredClients registered_clients;
+ m_journal_metadata->get_registered_clients(®istered_clients);
+
+ if (registered_clients.size() == 0) {
+ on_finish->complete(-EINVAL);
+ } else if (registered_clients.size() > 1) {
+ on_finish->complete(-EBUSY);
+ }
+ }
+
+ m_remove_set = std::numeric_limits<uint64_t>::max();
+ m_remove_set_pending = true;
+ m_remove_set_ctx = on_finish;
+
+ remove_set(m_journal_metadata->get_minimum_set());
+ });
+
+ m_async_op_tracker.wait_for_ops(on_finish);
+}
+
void JournalTrimmer::committed(uint64_t commit_tid) {
ldout(m_cct, 20) << __func__ << ": commit_tid=" << commit_tid << dendl;
m_journal_metadata->committed(commit_tid,
void shut_down(Context *on_finish);
int remove_objects(bool force);
+ void remove_objects(bool force, Context *on_finish);
void committed(uint64_t commit_tid);
private: