From 7d4c8781e548b36ed96de264cecc7f4b3fc80240 Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Thu, 9 May 2024 12:21:54 -0400 Subject: [PATCH] RGW: Rename rgw::sal::Object::get_obj_size() to get_size() Signed-off-by: Daniel Gryniewicz --- src/rgw/driver/d4n/rgw_sal_d4n.cc | 2 +- src/rgw/driver/motr/rgw_sal_motr.cc | 2 +- src/rgw/driver/posix/rgw_sal_posix.cc | 6 +++--- src/rgw/driver/posix/rgw_sal_posix.h | 2 +- src/rgw/driver/rados/rgw_cr_rados.cc | 2 +- src/rgw/driver/rados/rgw_lc_tier.cc | 2 +- src/rgw/rgw_admin.cc | 6 +++--- src/rgw/rgw_lc.cc | 10 +++++----- src/rgw/rgw_lua_request.cc | 2 +- src/rgw/rgw_op.cc | 14 +++++++------- src/rgw/rgw_rest_swift.cc | 4 ++-- src/rgw/rgw_sal.h | 2 +- src/rgw/rgw_sal_filter.h | 2 +- src/rgw/rgw_sal_store.h | 2 +- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.cc b/src/rgw/driver/d4n/rgw_sal_d4n.cc index 4976d059675f2..3b6124478a0fd 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.cc +++ b/src/rgw/driver/d4n/rgw_sal_d4n.cc @@ -944,7 +944,7 @@ int D4NFilterWriter::complete(size_t accounted_size, const std::string& etag, baseAttrs.insert({"mtime", bl}); bl.clear(); - bl.append(std::to_string(obj->get_obj_size())); + bl.append(std::to_string(obj->get_size())); baseAttrs.insert({"object_size", bl}); bl.clear(); diff --git a/src/rgw/driver/motr/rgw_sal_motr.cc b/src/rgw/driver/motr/rgw_sal_motr.cc index 7934b3a6173b2..740d82a330cc5 100644 --- a/src/rgw/driver/motr/rgw_sal_motr.cc +++ b/src/rgw/driver/motr/rgw_sal_motr.cc @@ -1393,7 +1393,7 @@ int MotrObject::MotrReadOp::prepare(optional_yield y, const DoutPrefixProvider* } // Skip opening an empty object. - if(source->get_obj_size() == 0) + if(source->get_size() == 0) return 0; // Open the object here. diff --git a/src/rgw/driver/posix/rgw_sal_posix.cc b/src/rgw/driver/posix/rgw_sal_posix.cc index ea4d154e0c881..312422109c461 100644 --- a/src/rgw/driver/posix/rgw_sal_posix.cc +++ b/src/rgw/driver/posix/rgw_sal_posix.cc @@ -597,7 +597,7 @@ int POSIXObject::fill_bde(const DoutPrefixProvider *dpp, optional_yield y, rgw_b bde.ver.epoch = 1; bde.exists = true; bde.meta.category = RGWObjCategory::Main; - bde.meta.size = get_obj_size(); + bde.meta.size = get_size(); bde.meta.mtime = get_mtime(); if (owner) { bde.meta.owner = owner->get_id().to_str(); @@ -606,7 +606,7 @@ int POSIXObject::fill_bde(const DoutPrefixProvider *dpp, optional_yield y, rgw_b bde.meta.owner = "unknown"; bde.meta.owner_display_name = "unknown"; } - bde.meta.accounted_size = get_obj_size(); + bde.meta.accounted_size = get_size(); bde.meta.storage_class = RGW_STORAGE_CLASS_STANDARD; bde.meta.appendable = true; bufferlist etag_bl; @@ -2244,7 +2244,7 @@ int POSIXObject::generate_mp_etag(const DoutPrefixProvider* dpp, optional_yield int POSIXObject::generate_etag(const DoutPrefixProvider* dpp, optional_yield y) { - int64_t left = get_obj_size(); + int64_t left = get_size(); int64_t cur_ofs = 0; MD5 hash; // Allow use of MD5 digest in FIPS mode for non-cryptographic purposes diff --git a/src/rgw/driver/posix/rgw_sal_posix.h b/src/rgw/driver/posix/rgw_sal_posix.h index ceb3d0b7ff365..ac83173a00d08 100644 --- a/src/rgw/driver/posix/rgw_sal_posix.h +++ b/src/rgw/driver/posix/rgw_sal_posix.h @@ -511,7 +511,7 @@ public: virtual ~POSIXMultipartPart() = default; virtual uint32_t get_num() { return info.num; } - virtual uint64_t get_size() { return shadow->get_obj_size(); } + virtual uint64_t get_size() { return shadow->get_size(); } virtual const std::string& get_etag() { return info.etag; } virtual ceph::real_time& get_mtime() { return info.mtime; } diff --git a/src/rgw/driver/rados/rgw_cr_rados.cc b/src/rgw/driver/rados/rgw_cr_rados.cc index 5e62bfbb76b13..41d5bed4a5510 100644 --- a/src/rgw/driver/rados/rgw_cr_rados.cc +++ b/src/rgw/driver/rados/rgw_cr_rados.cc @@ -952,7 +952,7 @@ int RGWAsyncRemoveObj::_send_request(const DoutPrefixProvider *dpp) } else { send_sync_notification( dpp, store, bucket.get(), obj.get(), obj->get_attrs(), - obj->get_obj_size(), + obj->get_size(), {rgw::notify::ObjectSyncedDelete, rgw::notify::ReplicationDelete}); } return ret; diff --git a/src/rgw/driver/rados/rgw_lc_tier.cc b/src/rgw/driver/rados/rgw_lc_tier.cc index 9fbc931ebcb95..eea5c9b01a7a2 100644 --- a/src/rgw/driver/rados/rgw_lc_tier.cc +++ b/src/rgw/driver/rados/rgw_lc_tier.cc @@ -426,7 +426,7 @@ int RGWLCStreamRead::init() { } attrs = obj->get_attrs(); - obj_size = obj->get_obj_size(); + obj_size = obj->get_size(); ret = init_rest_obj(); if (ret < 0) { diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index cfe0d944b58e6..4cf9a8db8fbb5 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -1643,7 +1643,7 @@ int check_min_obj_stripe_size(rgw::sal::Driver* driver, rgw::sal::Object* obj, u map::iterator iter; iter = obj->get_attrs().find(RGW_ATTR_MANIFEST); if (iter == obj->get_attrs().end()) { - *need_rewrite = (obj->get_obj_size() >= min_stripe_size); + *need_rewrite = (obj->get_size() >= min_stripe_size); return 0; } @@ -8562,7 +8562,7 @@ next: } formatter->open_object_section("object_metadata"); formatter->dump_string("name", object); - formatter->dump_unsigned("size", obj->get_obj_size()); + formatter->dump_unsigned("size", obj->get_size()); map::iterator iter; map other_attrs; @@ -8633,7 +8633,7 @@ next: } formatter->open_object_section("outer"); // name not displayed since top level - formatter->dump_unsigned("size", obj->get_obj_size()); + formatter->dump_unsigned("size", obj->get_size()); auto attr_iter = obj->get_attrs().find(RGW_ATTR_MANIFEST); if (attr_iter == obj->get_attrs().end()) { diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index b4f11c83bcf23..26c03dec187e9 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -523,10 +523,10 @@ static bool pass_size_limit_checks(const DoutPrefixProvider *dpp, lc_op_ctx& oc) bool lt_p{true}; if (op.size_gt) { - gt_p = (obj->get_obj_size() > op.size_gt.get()); + gt_p = (obj->get_size() > op.size_gt.get()); } if (op.size_lt) { - lt_p = (obj->get_obj_size() < op.size_lt.get()); + lt_p = (obj->get_size() < op.size_lt.get()); } return gt_p && lt_p; @@ -625,7 +625,7 @@ static int remove_expired_obj(const DoutPrefixProvider* dpp, fmt::format("ERROR: {} failed, with error: {}", __func__, ret) << dendl; } else { // send request to notification manager - int publish_ret = notify->publish_commit(dpp, obj->get_obj_size(), + int publish_ret = notify->publish_commit(dpp, obj->get_size(), ceph::real_clock::now(), etag, version_id); @@ -922,7 +922,7 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target, ret = mpu->abort(this, cct, null_yield); if (ret == 0) { int publish_ret = notify->publish_commit( - this, sal_obj->get_obj_size(), + this, sal_obj->get_size(), ceph::real_clock::now(), etag, version_id); @@ -1454,7 +1454,7 @@ public: return ret; } else { // send request to notification manager - int publish_ret = notify->publish_commit(oc.dpp, obj->get_obj_size(), + int publish_ret = notify->publish_commit(oc.dpp, obj->get_size(), ceph::real_clock::now(), etag, version_id); diff --git a/src/rgw/rgw_lua_request.cc b/src/rgw/rgw_lua_request.cc index 3caad29654532..3fd0cb94cb145 100644 --- a/src/rgw/rgw_lua_request.cc +++ b/src/rgw/rgw_lua_request.cc @@ -355,7 +355,7 @@ struct ObjectMetaTable : public EmptyMetaTable { } else if (strcasecmp(index, "Id") == 0) { pushstring(L, obj->get_oid()); } else if (strcasecmp(index, "Size") == 0) { - lua_pushinteger(L, obj->get_obj_size()); + lua_pushinteger(L, obj->get_size()); } else if (strcasecmp(index, "MTime") == 0) { pushtime(L, obj->get_mtime()); } else { diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 04099b149ae86..e1c7ee484f4c2 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1658,9 +1658,9 @@ int RGWGetObj::read_user_manifest_part(rgw::sal::Bucket* bucket, } else { - if (part->get_obj_size() != ent.meta.size) { + if (part->get_size() != ent.meta.size) { // hmm.. something wrong, object not as expected, abort! - ldpp_dout(this, 0) << "ERROR: expected obj_size=" << part->get_obj_size() + ldpp_dout(this, 0) << "ERROR: expected obj_size=" << part->get_size() << ", actual read size=" << ent.meta.size << dendl; return -EIO; } @@ -2235,7 +2235,7 @@ void RGWGetObj::execute(optional_yield y) op_ret = read_op->prepare(s->yield, this); version_id = s->object->get_instance(); - s->obj_size = s->object->get_obj_size(); + s->obj_size = s->object->get_size(); attrs = s->object->get_attrs(); multipart_parts_count = read_op->params.parts_count; if (op_ret < 0) @@ -3995,7 +3995,7 @@ int RGWPutObj::get_data(const off_t fst, const off_t lst, bufferlist& bl) if (ret < 0) return ret; - obj_size = obj->get_obj_size(); + obj_size = obj->get_size(); bool need_decompress; op_ret = rgw_compression_info_from_attrset(obj->get_attrs(), need_decompress, cs_info); @@ -5136,7 +5136,7 @@ void RGWDeleteObj::execute(optional_yield y) } } } else { - obj_size = s->object->get_obj_size(); + obj_size = s->object->get_size(); etag = s->object->get_attrs()[RGW_ATTR_ETAG].to_str(); } @@ -5550,7 +5550,7 @@ void RGWCopyObj::execute(optional_yield y) } } - obj_size = s->src_object->get_obj_size(); + obj_size = s->src_object->get_size(); if (!s->system_request) { // no quota enforcement for system requests if (s->src_object->get_accounted_size() > static_cast(s->cct->_conf->rgw_max_put_size)) { @@ -6724,7 +6724,7 @@ void RGWDeleteMultiObj::handle_individual_object(const rgw_obj_key& o, optional_ return; } } else { - obj_size = obj->get_obj_size(); + obj_size = obj->get_size(); etag = obj->get_attrs()[RGW_ATTR_ETAG].to_str(); } diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index fee38669b2dbd..35c36d1ae1a66 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -988,7 +988,7 @@ int RGWPutObj_ObjStore_SWIFT::update_slo_segment_size(rgw_slo_entry& entry) { return r; } - size_bytes = slo_seg->get_obj_size(); + size_bytes = slo_seg->get_size(); r = rgw_compression_info_from_attrset(slo_seg->get_attrs(), compressed, cs_info); if (r < 0) { @@ -2729,7 +2729,7 @@ bool RGWSwiftWebsiteHandler::is_web_dir() const const std::string subdir_marker = ws_conf.subdir_marker.empty() ? "application/directory" : ws_conf.subdir_marker; - return subdir_marker == content_type && obj->get_obj_size() <= 1; + return subdir_marker == content_type && obj->get_size() <= 1; } bool RGWSwiftWebsiteHandler::is_index_present(const std::string& index) const diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 51ec125039d6e..5fd20fda692ea 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -1208,7 +1208,7 @@ class Object { /** Set the cached modification time for this object */ virtual void set_mtime(ceph::real_time&) = 0; /** Get the cached size for this object */ - virtual uint64_t get_obj_size(void) const = 0; + virtual uint64_t get_size(void) const = 0; /** Get the cached accounted size for this object */ virtual uint64_t get_accounted_size(void) const = 0; /** Set the cached accounted size for this object */ diff --git a/src/rgw/rgw_sal_filter.h b/src/rgw/rgw_sal_filter.h index fe17ae9f3e807..7d26a466efe71 100644 --- a/src/rgw/rgw_sal_filter.h +++ b/src/rgw/rgw_sal_filter.h @@ -796,7 +796,7 @@ public: virtual bool get_attr(const std::string& name, bufferlist &dest) override { return next->get_attr(name, dest); } virtual ceph::real_time get_mtime(void) const override { return next->get_mtime(); }; virtual void set_mtime(ceph::real_time& mtime) override { return next->set_mtime(mtime); } - virtual uint64_t get_obj_size(void) const override { return next->get_obj_size(); }; + virtual uint64_t get_size(void) const override { return next->get_size(); }; virtual uint64_t get_accounted_size(void) const override { return next->get_accounted_size(); }; virtual void set_accounted_size(uint64_t size) override { return next->set_accounted_size(size); } virtual uint64_t get_epoch(void) const override { return next->get_epoch(); } diff --git a/src/rgw/rgw_sal_store.h b/src/rgw/rgw_sal_store.h index d37f63e5c8110..a8788f4f51cf3 100644 --- a/src/rgw/rgw_sal_store.h +++ b/src/rgw/rgw_sal_store.h @@ -312,7 +312,7 @@ class StoreObject : public Object { } virtual ceph::real_time get_mtime(void) const override { return state.mtime; } virtual void set_mtime(ceph::real_time& mtime) override { state.mtime = mtime; } - virtual uint64_t get_obj_size(void) const override { return state.size; } + virtual uint64_t get_size(void) const override { return state.size; } virtual uint64_t get_accounted_size(void) const override { return state.accounted_size; } virtual void set_accounted_size(uint64_t size) override { state.accounted_size = size; } virtual uint64_t get_epoch(void) const override { return state.epoch; } -- 2.39.5