]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix RGWAccess::init_storage_provider
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 25 May 2011 00:50:24 +0000 (17:50 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 25 May 2011 00:53:49 +0000 (17:53 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/rgw/rgw_access.cc
src/rgw/rgw_access.h
src/rgw/rgw_admin.cc
src/rgw/rgw_fs.cc
src/rgw/rgw_fs.h
src/rgw/rgw_main.cc

index 1166b75b8f381bf36e154d8d22f4fc5ba33168e4..468cafc086c47cb946bbf8931c976415b43d2ae1 100644 (file)
@@ -17,7 +17,7 @@ RGWAccess::~RGWAccess()
 {
 }
 
-RGWAccess *RGWAccess::init_storage_provider(const char *type, md_config_t *conf)
+RGWAccess *RGWAccess::init_storage_provider(const char *type, CephContext *cct)
 {
   if (strcmp(type, "rados") == 0) {
     store = &rados_provider;
@@ -27,7 +27,7 @@ RGWAccess *RGWAccess::init_storage_provider(const char *type, md_config_t *conf)
     store = NULL;
   }
 
-  if (store->initialize(conf) < 0)
+  if (store->initialize(cct) < 0)
     store = NULL;
 
   return store;
index 787ed62aa9739b41b566988c21ef199d6cbee7f1..f52dcb938c80798d41661ec2ece8e1b7a202f27d 100644 (file)
@@ -18,7 +18,7 @@ class RGWAccess {
 public:
   virtual ~RGWAccess();
   /** do all necessary setup of the storage device */
-  virtual int initialize(md_config_t *conf) { return 0; }
+  virtual int initialize(CephContext *cct) = 0;
   /** prepare a listing of all buckets. */
   virtual int list_buckets_init(std::string& id, RGWAccessHandle *handle) = 0;
   /** get the next bucket in the provided listing context. */
@@ -184,7 +184,7 @@ public:
    * Given the name of the storage provider, initialize it
    * with the given arguments.
    */
-  static RGWAccess *init_storage_provider(const char *type, md_config_t *conf);
+  static RGWAccess *init_storage_provider(const char *type, CephContext *cct);
   static RGWAccess *store;
 };
 
index df4f2d952f8868c4b7dfb8fd48e2e38416c6ba54..ba40d0421cdfe841df9185ec3d6c0a1f41b82355 100644 (file)
@@ -396,7 +396,7 @@ int main(int argc, char **argv)
                     opt_cmd == OPT_SUBUSER_CREATE || opt_cmd == OPT_SUBUSER_RM ||
                     opt_cmd == OPT_KEY_CREATE || opt_cmd == OPT_KEY_RM);
 
-  store = RGWAccess::init_storage_provider("rados", &g_conf);
+  store = RGWAccess::init_storage_provider("rados", &g_ceph_context);
   if (!store) {
     cerr << "couldn't init storage provider" << std::endl;
     return 5; //EIO
index ff8091d04b91964c6ef6c6db368dfa5117240200..6ea2f99da72fcd9ce6f08a303b732a8e02c83a79 100644 (file)
@@ -26,6 +26,11 @@ struct rgwfs_state {
 
 #define DIR_NAME "/tmp/radosgw"
 
+int RGWFS::initialize(CephContext *cct)
+{
+  return 0;
+}
+
 int RGWFS::list_buckets_init(string& id, RGWAccessHandle *handle)
 {
   DIR *dir = opendir(DIR_NAME);
index b2e424d6181821905fe8bb1c670f8b818e33a0fb..e4c5deb9d7a372497e0a447e0da739f8fbb1bc87 100644 (file)
@@ -10,6 +10,7 @@ class RGWFS  : public RGWAccess
     int fd;
   };
 public:
+  virtual int initialize(CephContext *cct);
   int list_buckets_init(std::string& id, RGWAccessHandle *handle);
   int list_buckets_next(std::string& id, RGWObjEnt& obj, RGWAccessHandle *handle);
 
index 944e19f133bfd36c0ff622f37ccf205688b7c98d..559016b7eb13d47d77b3edbf8c232a9246565ea9 100644 (file)
@@ -77,7 +77,7 @@ int main(int argc, const char **argv)
   common_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(&g_ceph_context);
 
-  if (!RGWAccess::init_storage_provider("rados", &g_conf)) {
+  if (!RGWAccess::init_storage_provider("rados", &g_ceph_context)) {
     derr << "Couldn't init storage provider (RADOS)" << dendl;
     return EIO;
   }