return -EIO;
}
- op_ret = get_store()->getRados()->check_quota(s->bucket_owner.get_id(),
- s->bucket->get_bi(), user_quota, bucket_quota,
- real_ofs, true);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, real_ofs, true);
/* max_size exceed */
if (op_ret < 0)
return -EIO;
goto done;
}
- op_ret = get_store()->getRados()->check_quota(s->bucket_owner.get_id(),
- s->bucket->get_bi(), user_quota, bucket_quota,
- s->obj_size, true);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, s->obj_size, true);
/* max_size exceed */
if (op_ret < 0) {
goto done;
if (!chunked_upload) { /* with chunked upload we don't know how big is the upload.
we also check sizes at the end anyway */
- op_ret = store->getRados()->check_quota(s->bucket_owner.get_id(), s->bucket->get_bi(),
- user_quota, bucket_quota, s->content_length);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, s->content_length);
if (op_ret < 0) {
ldpp_dout(this, 20) << "check_quota() returned ret=" << op_ret << dendl;
return;
return;
}
- op_ret = store->getRados()->check_quota(s->bucket_owner.get_id(), s->bucket->get_bi(),
- user_quota, bucket_quota, s->obj_size);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, s->obj_size);
if (op_ret < 0) {
ldpp_dout(this, 20) << "second check_quota() returned op_ret=" << op_ret << dendl;
return;
ceph::buffer::list bl, aclbl;
int len = 0;
- op_ret = store->getRados()->check_quota(s->bucket_owner.get_id(),
- s->bucket->get_bi(),
- user_quota,
- bucket_quota,
- s->content_length);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, s->content_length);
if (op_ret < 0) {
return;
}
s->object->set_obj_size(ofs);
- op_ret = store->getRados()->check_quota(s->bucket_owner.get_id(), s->bucket->get_bi(),
- user_quota, bucket_quota, s->obj_size);
+ op_ret = s->bucket->check_quota(user_quota, bucket_quota, s->obj_size);
if (op_ret < 0) {
return;
}
return op_ret;
}
- op_ret = store->getRados()->check_quota(s->user->get_id(), bucket->get_bi(),
- user_quota, bucket_quota, size);
+ op_ret = bucket->check_quota(user_quota, bucket_quota, size);
if (op_ret < 0) {
return op_ret;
}
return op_ret;
}
- op_ret = store->getRados()->check_quota(bowner.get_id(), bucket->get_bi(),
- user_quota, bucket_quota, size);
+ op_ret = bucket->check_quota(user_quota, bucket_quota, size);
if (op_ret < 0) {
ldpp_dout(this, 20) << "quota exceeded for path=" << path << dendl;
return op_ret;
return store->getRados()->check_bucket_empty(info, y);
}
-int RGWRadosBucket::check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size)
+int RGWRadosBucket::check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, bool check_size_only)
{
return store->getRados()->check_quota(owner->get_user(), get_bi(),
- user_quota, bucket_quota, obj_size);
+ user_quota, bucket_quota, obj_size, check_size_only);
}
int RGWRadosBucket::set_acl(RGWAccessControlPolicy &acl, optional_yield y)
virtual int put_instance_info(bool exclusive, ceph::real_time mtime) = 0;
virtual bool is_owner(RGWUser* user) = 0;
virtual int check_empty(optional_yield y) = 0;
- virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size) = 0;
+ virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, bool check_size_only = false) = 0;
bool empty() const { return info.bucket.name.empty(); }
const std::string& get_name() const { return info.bucket.name; }
virtual int put_instance_info(bool exclusive, ceph::real_time mtime) override;
virtual bool is_owner(RGWUser* user) override;
virtual int check_empty(optional_yield y) override;
- virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size) override;
+ virtual int check_quota(RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, uint64_t obj_size, bool check_size_only = false) override;
virtual std::unique_ptr<RGWBucket> clone() {
return std::unique_ptr<RGWBucket>(new RGWRadosBucket(*this));
}