]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove get_bucket_info and convert users.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 28 Sep 2011 21:26:17 +0000 (14:26 -0700)
committerSage Weil <sage@newdream.net>
Thu, 29 Sep 2011 15:38:15 +0000 (08:38 -0700)
This just lives in struct rgw_bucket now.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/rgw/rgw_access.h
src/rgw/rgw_admin.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 632b9da9cf120a312fda7444a90062a983202b9c..ee219228cbf996dadf89b1aafc5da1dd27000425 100644 (file)
@@ -221,8 +221,6 @@ public:
    */
   virtual int set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl) = 0;
 
-  virtual int get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id) { return -ENOTSUP; }
-
  /**
   * stat an object
   */
index 7112be1f28310b89ecb69eb75184934a663de00a..718dbed8bd3997597a47d093d4b4f96095554996 100644 (file)
@@ -1223,15 +1223,9 @@ int main(int argc, char **argv)
     info.bucket = bucket;
     info.owner = policy.get_owner().get_id();
 
-    uint64_t bucket_id;
-    ret = rgwstore->get_bucket_id(bucket, &bucket_id);
+    ret = rgw_store_bucket_info_id(bucket.bucket_id, info);
     if (ret < 0) {
-      RGW_LOG(0) << "get_bucket_id returned " << ret << dendl;
-      return ret;
-    }
-    ret = rgw_store_bucket_info_id(bucket_id, info);
-    if (ret < 0) {
-      RGW_LOG(0) << "can't store pool info: bucket_id=" << bucket_id << " ret=" << ret << dendl;
+      RGW_LOG(0) << "can't store pool info: bucket_id=" << bucket.bucket_id << " ret=" << ret << dendl;
       return ret;
     }
   }
index 1faa4d326ba1f56610c0ea6ec1672e5283b4646b..c13078f96c978def2e81ab2ed0c96f67eeebeb88 100644 (file)
@@ -444,7 +444,6 @@ void RGWCreateBucket::execute()
   bufferlist aclbl;
   bool existed;
   bool pol_ret;
-  uint64_t bucket_id;
   RGWBucketInfo info;
 
   rgw_obj obj(rgw_root_bucket, s->bucket_name_str);
@@ -487,13 +486,9 @@ void RGWCreateBucket::execute()
   if (ret == -EEXIST)
     ret = 0;
 
-  ret = rgwstore->get_bucket_id(s->bucket, &bucket_id);
-  if (ret < 0)
-    goto done;
-
   info.owner = s->user.user_id;
   info.bucket = s->bucket;
-  rgw_store_bucket_info_id(bucket_id, info);
+  rgw_store_bucket_info_id(info.bucket.bucket_id, info);
 
 done:
   send_response();
index 6cd8f64a52f20985adb57b8e37fa0ed1e93f8bc0..8ae1c8252da359ec9a126673b36dbdd69c962b3f 100644 (file)
@@ -1562,19 +1562,6 @@ int RGWRados::obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime)
   return r;
 }
 
-int RGWRados::get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id)
-{
-  librados::IoCtx io_ctx;
-  int r = open_bucket_ctx(bucket, io_ctx);
-  if (r == -ENOENT)
-    r = -ERR_NO_SUCH_BUCKET;
-  if (r < 0)
-    return r;
-
-  *bucket_id = io_ctx.get_id();
-  return 0;
-}
-
 int RGWRados::get_bucket_stats(rgw_bucket& bucket, map<RGWObjCategory, RGWBucketStats>& stats)
 {
   rgw_bucket_dir_header header;
index 3d01208145fbeba6a9484bc3eb72ce0c6deb2236..ff9dc58b0917b4e47c021a2d68a80774336eeaac 100644 (file)
@@ -244,8 +244,6 @@ public:
 
   virtual int obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime);
 
-  virtual int get_bucket_id(rgw_bucket& bucket, uint64_t *bucket_id);
-
   virtual bool supports_tmap() { return true; }
   virtual int tmap_get(rgw_obj& obj, bufferlist& header, std::map<string, bufferlist>& m);
   virtual int tmap_set(rgw_obj& obj, std::string& key, bufferlist& bl);