]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: switch bucket creation operations
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 10 May 2011 12:15:15 +0000 (05:15 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 10 May 2011 12:15:15 +0000 (05:15 -0700)
First we create the pool, then we create the bucket object. This
should have the effect of making the bucket creation sync.

src/rgw/rgw_op.cc

index 1e9faa01250d0df20f12e437a79330b1ae807914..8ca01af9f0406020a162b6a77917fdf863ecd33e 100644 (file)
@@ -327,7 +327,8 @@ void RGWCreateBucket::execute()
 
   attrs[RGW_ATTR_ACL] = aclbl;
 
-  ret = rgw_add_bucket(s->user.user_id, s->bucket_str);
+  ret = rgwstore->create_bucket(s->user.user_id, s->bucket_str, attrs,
+                               s->user.auid);
   /* continue if EEXIST and create_bucket will fail below.  this way we can recover
    * from a partial create by retrying it. */
   if (ret && ret != -EEXIST)   
@@ -335,8 +336,7 @@ void RGWCreateBucket::execute()
 
   existed = (ret == -EEXIST);
 
-  ret = rgwstore->create_bucket(s->user.user_id, s->bucket_str, attrs,
-                               s->user.auid);
+  ret = rgw_add_bucket(s->user.user_id, s->bucket_str);
   if (ret && !existed && ret != -EEXIST)   /* if it exists (or previously existed), don't remove it! */
     rgw_remove_bucket(s->user.user_id, s->bucket_str);