From e36db984c05bcc95be6658454e37b40dab0a0b99 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 10 Feb 2016 14:53:49 -0800 Subject: [PATCH] rgw: more api adjustments Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_cr_rados.cc | 4 ++-- src/rgw/rgw_cr_rados.h | 2 +- src/rgw/rgw_http_client.cc | 2 +- src/rgw/rgw_rados.cc | 10 +++++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index d66265b6d6e43..9a5828bbdf6b1 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -31,7 +31,7 @@ RGWAsyncRadosRequest *RGWAsyncRadosProcessor::RGWWQ::_dequeue() { return req; } -void RGWAsyncRadosProcessor::RGWWQ::_process(RGWAsyncRadosRequest *req) { +void RGWAsyncRadosProcessor::RGWWQ::_process(RGWAsyncRadosRequest *req, ThreadPool::TPHandle& handle) { processor->handle_request(req); processor->req_throttle.put(1); } @@ -52,7 +52,7 @@ void RGWAsyncRadosProcessor::RGWWQ::_dump_queue() { } RGWAsyncRadosProcessor::RGWAsyncRadosProcessor(RGWRados *_store, int num_threads) - : store(_store), m_tp(store->ctx(), "RGWAsyncRadosProcessor::m_tp", num_threads), + : store(_store), m_tp(store->ctx(), "RGWAsyncRadosProcessor::m_tp", "rados_async", num_threads), req_throttle(store->ctx(), "rgw_async_rados_ops", num_threads * 2), req_wq(this, g_conf->rgw_op_thread_timeout, g_conf->rgw_op_thread_suicide_timeout, &m_tp) { diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index 8d133dfa5e576..76db4cfb01639 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -45,7 +45,7 @@ protected: bool _empty(); RGWAsyncRadosRequest *_dequeue(); using ThreadPool::WorkQueue::_process; - void _process(RGWAsyncRadosRequest *req); + void _process(RGWAsyncRadosRequest *req, ThreadPool::TPHandle& handle); void _dump_queue(); void _clear() { assert(processor->m_req_queue.empty()); diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 2eae6b5939c23..a3ddf94c3cbf2 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -513,7 +513,7 @@ int RGWHTTPManager::set_threaded() { is_threaded = true; reqs_thread = new ReqsThread(this); - reqs_thread->create(); + reqs_thread->create("http_manager"); int r = pipe(thread_pipe); if (r < 0) { diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index c1024c608d20c..29b237b607e84 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2080,7 +2080,7 @@ public: void RGWRadosThread::start() { worker = new Worker(cct, this); - worker->create(); + worker->create("radosgw"); } void RGWRadosThread::stop() @@ -6088,6 +6088,14 @@ int RGWRados::Object::Delete::delete_obj() if (r < 0) return r; + if (params.unmod_since > 0) { + time_t ctime = state->mtime; + + ldout(store->ctx(), 10) << "If-UnModified-Since: " << params.unmod_since << " Last-Modified: " << ctime << dendl; + if (ctime > params.unmod_since) { + return -ERR_PRECONDITION_FAILED; + } + } uint64_t obj_size = state->size; if (!params.expiration_time.is_zero()) { -- 2.39.5