X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Frgw%2Frgw_lib_frontend.h;fp=src%2Fceph%2Fsrc%2Frgw%2Frgw_lib_frontend.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=0300faaefb9fc2e223c9281cc0c6b7beadde64a4;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/rgw/rgw_lib_frontend.h b/src/ceph/src/rgw/rgw_lib_frontend.h deleted file mode 100644 index 0300faa..0000000 --- a/src/ceph/src/rgw/rgw_lib_frontend.h +++ /dev/null @@ -1,115 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef RGW_LIB_FRONTEND_H -#define RGW_LIB_FRONTEND_H - -#include - -#include - -#include "rgw_lib.h" -#include "rgw_file.h" - -namespace rgw { - - class RGWLibProcess : public RGWProcess { - RGWAccessKey access_key; - std::mutex mtx; - int gen; - bool shutdown; - - typedef flat_map FSMAP; - FSMAP mounted_fs; - - using lock_guard = std::lock_guard; - using unique_lock = std::unique_lock; - - public: - RGWLibProcess(CephContext* cct, RGWProcessEnv* pe, int num_threads, - RGWFrontendConfig* _conf) : - RGWProcess(cct, pe, num_threads, _conf), gen(0), shutdown(false) {} - - void run() override; - void checkpoint(); - - void stop() { - shutdown = true; - for (const auto& fs: mounted_fs) { - fs.second->stop(); - } - } - - void register_fs(RGWLibFS* fs) { - lock_guard guard(mtx); - mounted_fs.insert(FSMAP::value_type(fs, fs)); - ++gen; - } - - void unregister_fs(RGWLibFS* fs) { - lock_guard guard(mtx); - FSMAP::iterator it = mounted_fs.find(fs); - if (it != mounted_fs.end()) { - mounted_fs.erase(it); - ++gen; - } - } - - void enqueue_req(RGWLibRequest* req) { - - lsubdout(g_ceph_context, rgw, 10) - << __func__ << " enqueue request req=" - << hex << req << dec << dendl; - - req_throttle.get(1); - req_wq.queue(req); - } /* enqueue_req */ - - /* "regular" requests */ - void handle_request(RGWRequest* req) override; // async handler, deletes req - int process_request(RGWLibRequest* req); - int process_request(RGWLibRequest* req, RGWLibIO* io); - void set_access_key(RGWAccessKey& key) { access_key = key; } - - /* requests w/continue semantics */ - int start_request(RGWLibContinuedReq* req); - int finish_request(RGWLibContinuedReq* req); - }; /* RGWLibProcess */ - - class RGWLibFrontend : public RGWProcessFrontend { - public: - RGWLibFrontend(RGWProcessEnv& pe, RGWFrontendConfig *_conf) - : RGWProcessFrontend(pe, _conf) {} - - int init() override; - - void stop() override { - RGWProcessFrontend::stop(); - get_process()->stop(); - } - - RGWLibProcess* get_process() { - return static_cast(pprocess); - } - - inline void enqueue_req(RGWLibRequest* req) { - static_cast(pprocess)->enqueue_req(req); // async - } - - inline int execute_req(RGWLibRequest* req) { - return static_cast(pprocess)->process_request(req); // !async - } - - inline int start_req(RGWLibContinuedReq* req) { - return static_cast(pprocess)->start_request(req); - } - - inline int finish_req(RGWLibContinuedReq* req) { - return static_cast(pprocess)->finish_request(req); - } - - }; /* RGWLibFrontend */ - -} /* namespace rgw */ - -#endif /* RGW_LIB_FRONTEND_H */