}
int DaosBucket::remove_bucket(const DoutPrefixProvider* dpp,
- bool delete_children, bool forward_to_master,
- req_info* req_info, optional_yield y) {
+ bool delete_children, optional_yield y) {
ldpp_dout(dpp, 20) << "DEBUG: remove_bucket, delete_children="
-
- << delete_children
-
- << " forward_to_master=" << forward_to_master << dendl;
+ << delete_children << dendl;
return ds3_bucket_destroy(get_name().c_str(), delete_children, store->ds3,
nullptr);
virtual int list(const DoutPrefixProvider* dpp, ListParams&, int,
ListResults&, optional_yield y) override;
virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children,
- bool forward_to_master, req_info* req_info,
optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max,
bool keep_index_consistent,
return 0;
}
-int MotrBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y)
+int MotrBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, optional_yield y)
{
int ret;
virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) override;
- virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) override;
+ virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max, bool
keep_index_consistent,
optional_yield y, const
int POSIXBucket::remove_bucket(const DoutPrefixProvider* dpp,
bool delete_children,
- bool forward_to_master,
- req_info* req_info,
optional_yield y)
{
return delete_directory(parent_fd, get_fname().c_str(),
optional_yield y,
const DoutPrefixProvider *dpp)
{
- return remove_bucket(dpp, true, false, nullptr, y);
+ return remove_bucket(dpp, true, y);
}
int POSIXBucket::load_bucket(const DoutPrefixProvider* dpp, optional_yield y)
if (!b->versioned()) {
if (shadow) {
- ret = shadow->remove_bucket(dpp, true, false, nullptr, y);
+ ret = shadow->remove_bucket(dpp, true, y);
if (ret < 0) {
return ret;
}
return ret;
}
- shadow->remove_bucket(dpp, true, false, nullptr, y);
+ shadow->remove_bucket(dpp, true, y);
return 0;
}
virtual int merge_and_store_attrs(const DoutPrefixProvider* dpp,
Attrs& new_attrs, optional_yield y) override;
virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children,
- bool forward_to_master, req_info* req_info,
optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max,
bool keep_index_consistent,
if (bypass_gc)
ret = bucket->remove_bucket_bypass_gc(op_state.get_max_aio(), keep_index_consistent, y, dpp);
else
- ret = bucket->remove_bucket(dpp, op_state.will_delete_children(),
- false, nullptr, y);
+ ret = bucket->remove_bucket(dpp, op_state.will_delete_children(), y);
return ret;
}
RESTArgs::get_string(s, "bucket", bucket_name, &bucket_name);
RESTArgs::get_bool(s, "purge-objects", false, &delete_children);
- /* FIXME We're abusing the owner of the bucket to pass the user, so that it can be forwarded to
- * the master. This user is actually the OP caller, not the bucket owner. */
- op_ret = driver->get_bucket(s, s->user.get(), string(), bucket_name, &bucket, y);
+ bufferlist data;
+ op_ret = driver->forward_request_to_master(s, s->user.get(), nullptr, data, nullptr, s->info, y);
+ if (op_ret < 0) {
+ ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl;
+ if (op_ret == -ENOENT) {
+ /* adjust error, we want to return with NoSuchBucket and not
+ * NoSuchKey */
+ op_ret = -ERR_NO_SUCH_BUCKET;
+ }
+ return;
+ }
+
+ op_ret = driver->get_bucket(s, nullptr, string(), bucket_name, &bucket, y);
if (op_ret < 0) {
ldpp_dout(this, 0) << "get_bucket returned ret=" << op_ret << dendl;
if (op_ret == -ENOENT) {
return;
}
- op_ret = bucket->remove_bucket(s, delete_children, true, &s->info, s->yield);
+ op_ret = bucket->remove_bucket(s, delete_children, s->yield);
}
class RGWOp_Set_Bucket_Quota : public RGWRESTOp {
int RadosBucket::remove_bucket(const DoutPrefixProvider* dpp,
bool delete_children,
- bool forward_to_master,
- req_info* req_info,
optional_yield y)
{
int ret;
ldpp_dout(dpp, -1) << "ERROR: unable to remove user bucket information" << dendl;
}
- if (forward_to_master) {
- bufferlist in_data;
- ret = store->forward_request_to_master(dpp, owner, &ot.read_version, in_data, nullptr, *req_info, y);
- if (ret < 0) {
- if (ret == -ENOENT) {
- /* adjust error, we want to return with NoSuchBucket and not
- * NoSuchKey */
- ret = -ERR_NO_SUCH_BUCKET;
- }
- return ret;
- }
- }
-
return ret;
}
// this function can only be run if caller wanted children to be
// deleted, so we can ignore the check for children as any that
// remain are detritus from a prior bug
- ret = remove_bucket(dpp, true, false, nullptr, y);
+ ret = remove_bucket(dpp, true, y);
if (ret < 0) {
ldpp_dout(dpp, -1) << "ERROR: could not remove bucket " << this << dendl;
return ret;
virtual ~RadosBucket();
virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
virtual int list(const DoutPrefixProvider* dpp, ListParams&, int, ListResults&, optional_yield y) override;
- virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) override;
+ virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children, optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max, bool
keep_index_consistent,
optional_yield y, const
return ret;
}
- ret = bucket->remove_bucket(dpp, true, false, nullptr, y);
+ ret = bucket->remove_bucket(dpp, true, y);
if (ret < 0) {
set_err_msg(err_msg, "unable to delete user data");
return ret;
// do nothing; it will already have been logged
}
- op_ret = s->bucket->remove_bucket(this, false, false, nullptr, y);
+ op_ret = s->bucket->remove_bucket(this, false, y);
if (op_ret < 0 && op_ret == -ECANCELED) {
// lost a race, either with mdlog sync or another delete bucket operation.
// in either case, we've already called ctl.bucket->unlink_bucket()
goto delop_fail;
}
}
- ret = bucket->remove_bucket(dpp, false, false, nullptr, s->yield);
+ ret = bucket->remove_bucket(dpp, false, s->yield);
if (ret < 0) {
goto delop_fail;
}
/** Set the cached attributes on this bucket */
virtual int set_attrs(Attrs a) = 0;
/** Remove this bucket from the backing store */
- virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) = 0;
+ virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children, optional_yield y) = 0;
/** Remove this bucket, bypassing garbage collection. May be removed */
virtual int remove_bucket_bypass_gc(int concurrent_max, bool
keep_index_consistent,
return 0;
}
- int DBBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y)
+ int DBBucket::remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, optional_yield y)
{
int ret;
virtual std::unique_ptr<Object> get_object(const rgw_obj_key& k) override;
virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) override;
- virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) override;
+ virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max, bool
keep_index_consistent,
optional_yield y, const
int FilterBucket::remove_bucket(const DoutPrefixProvider* dpp,
bool delete_children,
- bool forward_to_master,
- req_info* req_info,
optional_yield y)
{
- return next->remove_bucket(dpp, delete_children, forward_to_master, req_info, y);
+ return next->remove_bucket(dpp, delete_children, y);
}
int FilterBucket::remove_bucket_bypass_gc(int concurrent_max,
virtual Attrs& get_attrs(void) override { return next->get_attrs(); }
virtual int set_attrs(Attrs a) override { return next->set_attrs(a); }
virtual int remove_bucket(const DoutPrefixProvider* dpp, bool delete_children,
- bool forward_to_master, req_info* req_info,
optional_yield y) override;
virtual int remove_bucket_bypass_gc(int concurrent_max, bool
keep_index_consistent,