Skip to content

Commit 7d4c878

Browse files
committed
RGW: Rename rgw::sal::Object::get_obj_size() to get_size()
Signed-off-by: Daniel Gryniewicz <[email protected]>
1 parent bd11f19 commit 7d4c878

File tree

14 files changed

+29
-29
lines changed

14 files changed

+29
-29
lines changed

src/rgw/driver/d4n/rgw_sal_d4n.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ int D4NFilterWriter::complete(size_t accounted_size, const std::string& etag,
944944
baseAttrs.insert({"mtime", bl});
945945
bl.clear();
946946

947-
bl.append(std::to_string(obj->get_obj_size()));
947+
bl.append(std::to_string(obj->get_size()));
948948
baseAttrs.insert({"object_size", bl});
949949
bl.clear();
950950

src/rgw/driver/motr/rgw_sal_motr.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ int MotrObject::MotrReadOp::prepare(optional_yield y, const DoutPrefixProvider*
13931393
}
13941394

13951395
// Skip opening an empty object.
1396-
if(source->get_obj_size() == 0)
1396+
if(source->get_size() == 0)
13971397
return 0;
13981398

13991399
// Open the object here.

src/rgw/driver/posix/rgw_sal_posix.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ int POSIXObject::fill_bde(const DoutPrefixProvider *dpp, optional_yield y, rgw_b
597597
bde.ver.epoch = 1;
598598
bde.exists = true;
599599
bde.meta.category = RGWObjCategory::Main;
600-
bde.meta.size = get_obj_size();
600+
bde.meta.size = get_size();
601601
bde.meta.mtime = get_mtime();
602602
if (owner) {
603603
bde.meta.owner = owner->get_id().to_str();
@@ -606,7 +606,7 @@ int POSIXObject::fill_bde(const DoutPrefixProvider *dpp, optional_yield y, rgw_b
606606
bde.meta.owner = "unknown";
607607
bde.meta.owner_display_name = "unknown";
608608
}
609-
bde.meta.accounted_size = get_obj_size();
609+
bde.meta.accounted_size = get_size();
610610
bde.meta.storage_class = RGW_STORAGE_CLASS_STANDARD;
611611
bde.meta.appendable = true;
612612
bufferlist etag_bl;
@@ -2244,7 +2244,7 @@ int POSIXObject::generate_mp_etag(const DoutPrefixProvider* dpp, optional_yield
22442244

22452245
int POSIXObject::generate_etag(const DoutPrefixProvider* dpp, optional_yield y)
22462246
{
2247-
int64_t left = get_obj_size();
2247+
int64_t left = get_size();
22482248
int64_t cur_ofs = 0;
22492249
MD5 hash;
22502250
// Allow use of MD5 digest in FIPS mode for non-cryptographic purposes

src/rgw/driver/posix/rgw_sal_posix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ class POSIXMultipartPart : public StoreMultipartPart {
511511
virtual ~POSIXMultipartPart() = default;
512512

513513
virtual uint32_t get_num() { return info.num; }
514-
virtual uint64_t get_size() { return shadow->get_obj_size(); }
514+
virtual uint64_t get_size() { return shadow->get_size(); }
515515
virtual const std::string& get_etag() { return info.etag; }
516516
virtual ceph::real_time& get_mtime() { return info.mtime; }
517517

src/rgw/driver/rados/rgw_cr_rados.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ int RGWAsyncRemoveObj::_send_request(const DoutPrefixProvider *dpp)
952952
} else {
953953
send_sync_notification(
954954
dpp, store, bucket.get(), obj.get(), obj->get_attrs(),
955-
obj->get_obj_size(),
955+
obj->get_size(),
956956
{rgw::notify::ObjectSyncedDelete, rgw::notify::ReplicationDelete});
957957
}
958958
return ret;

src/rgw/driver/rados/rgw_lc_tier.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ int RGWLCStreamRead::init() {
426426
}
427427

428428
attrs = obj->get_attrs();
429-
obj_size = obj->get_obj_size();
429+
obj_size = obj->get_size();
430430

431431
ret = init_rest_obj();
432432
if (ret < 0) {

src/rgw/rgw_admin.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ int check_min_obj_stripe_size(rgw::sal::Driver* driver, rgw::sal::Object* obj, u
16431643
map<string, bufferlist>::iterator iter;
16441644
iter = obj->get_attrs().find(RGW_ATTR_MANIFEST);
16451645
if (iter == obj->get_attrs().end()) {
1646-
*need_rewrite = (obj->get_obj_size() >= min_stripe_size);
1646+
*need_rewrite = (obj->get_size() >= min_stripe_size);
16471647
return 0;
16481648
}
16491649

@@ -8562,7 +8562,7 @@ int main(int argc, const char **argv)
85628562
}
85638563
formatter->open_object_section("object_metadata");
85648564
formatter->dump_string("name", object);
8565-
formatter->dump_unsigned("size", obj->get_obj_size());
8565+
formatter->dump_unsigned("size", obj->get_size());
85668566

85678567
map<string, bufferlist>::iterator iter;
85688568
map<string, bufferlist> other_attrs;
@@ -8633,7 +8633,7 @@ int main(int argc, const char **argv)
86338633
}
86348634

86358635
formatter->open_object_section("outer"); // name not displayed since top level
8636-
formatter->dump_unsigned("size", obj->get_obj_size());
8636+
formatter->dump_unsigned("size", obj->get_size());
86378637

86388638
auto attr_iter = obj->get_attrs().find(RGW_ATTR_MANIFEST);
86398639
if (attr_iter == obj->get_attrs().end()) {

src/rgw/rgw_lc.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,10 @@ static bool pass_size_limit_checks(const DoutPrefixProvider *dpp, lc_op_ctx& oc)
523523
bool lt_p{true};
524524

525525
if (op.size_gt) {
526-
gt_p = (obj->get_obj_size() > op.size_gt.get());
526+
gt_p = (obj->get_size() > op.size_gt.get());
527527
}
528528
if (op.size_lt) {
529-
lt_p = (obj->get_obj_size() < op.size_lt.get());
529+
lt_p = (obj->get_size() < op.size_lt.get());
530530
}
531531

532532
return gt_p && lt_p;
@@ -625,7 +625,7 @@ static int remove_expired_obj(const DoutPrefixProvider* dpp,
625625
fmt::format("ERROR: {} failed, with error: {}", __func__, ret) << dendl;
626626
} else {
627627
// send request to notification manager
628-
int publish_ret = notify->publish_commit(dpp, obj->get_obj_size(),
628+
int publish_ret = notify->publish_commit(dpp, obj->get_size(),
629629
ceph::real_clock::now(),
630630
etag,
631631
version_id);
@@ -922,7 +922,7 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target,
922922
ret = mpu->abort(this, cct, null_yield);
923923
if (ret == 0) {
924924
int publish_ret = notify->publish_commit(
925-
this, sal_obj->get_obj_size(),
925+
this, sal_obj->get_size(),
926926
ceph::real_clock::now(),
927927
etag,
928928
version_id);
@@ -1454,7 +1454,7 @@ class LCOpAction_Transition : public LCOpAction {
14541454
return ret;
14551455
} else {
14561456
// send request to notification manager
1457-
int publish_ret = notify->publish_commit(oc.dpp, obj->get_obj_size(),
1457+
int publish_ret = notify->publish_commit(oc.dpp, obj->get_size(),
14581458
ceph::real_clock::now(),
14591459
etag,
14601460
version_id);

src/rgw/rgw_lua_request.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ struct ObjectMetaTable : public EmptyMetaTable {
355355
} else if (strcasecmp(index, "Id") == 0) {
356356
pushstring(L, obj->get_oid());
357357
} else if (strcasecmp(index, "Size") == 0) {
358-
lua_pushinteger(L, obj->get_obj_size());
358+
lua_pushinteger(L, obj->get_size());
359359
} else if (strcasecmp(index, "MTime") == 0) {
360360
pushtime(L, obj->get_mtime());
361361
} else {

src/rgw/rgw_op.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,9 +1658,9 @@ int RGWGetObj::read_user_manifest_part(rgw::sal::Bucket* bucket,
16581658
}
16591659
else
16601660
{
1661-
if (part->get_obj_size() != ent.meta.size) {
1661+
if (part->get_size() != ent.meta.size) {
16621662
// hmm.. something wrong, object not as expected, abort!
1663-
ldpp_dout(this, 0) << "ERROR: expected obj_size=" << part->get_obj_size()
1663+
ldpp_dout(this, 0) << "ERROR: expected obj_size=" << part->get_size()
16641664
<< ", actual read size=" << ent.meta.size << dendl;
16651665
return -EIO;
16661666
}
@@ -2235,7 +2235,7 @@ void RGWGetObj::execute(optional_yield y)
22352235

22362236
op_ret = read_op->prepare(s->yield, this);
22372237
version_id = s->object->get_instance();
2238-
s->obj_size = s->object->get_obj_size();
2238+
s->obj_size = s->object->get_size();
22392239
attrs = s->object->get_attrs();
22402240
multipart_parts_count = read_op->params.parts_count;
22412241
if (op_ret < 0)
@@ -3995,7 +3995,7 @@ int RGWPutObj::get_data(const off_t fst, const off_t lst, bufferlist& bl)
39953995
if (ret < 0)
39963996
return ret;
39973997

3998-
obj_size = obj->get_obj_size();
3998+
obj_size = obj->get_size();
39993999

40004000
bool need_decompress;
40014001
op_ret = rgw_compression_info_from_attrset(obj->get_attrs(), need_decompress, cs_info);
@@ -5136,7 +5136,7 @@ void RGWDeleteObj::execute(optional_yield y)
51365136
}
51375137
}
51385138
} else {
5139-
obj_size = s->object->get_obj_size();
5139+
obj_size = s->object->get_size();
51405140
etag = s->object->get_attrs()[RGW_ATTR_ETAG].to_str();
51415141
}
51425142

@@ -5550,7 +5550,7 @@ void RGWCopyObj::execute(optional_yield y)
55505550
}
55515551
}
55525552

5553-
obj_size = s->src_object->get_obj_size();
5553+
obj_size = s->src_object->get_size();
55545554

55555555
if (!s->system_request) { // no quota enforcement for system requests
55565556
if (s->src_object->get_accounted_size() > static_cast<size_t>(s->cct->_conf->rgw_max_put_size)) {
@@ -6724,7 +6724,7 @@ void RGWDeleteMultiObj::handle_individual_object(const rgw_obj_key& o, optional_
67246724
return;
67256725
}
67266726
} else {
6727-
obj_size = obj->get_obj_size();
6727+
obj_size = obj->get_size();
67286728
etag = obj->get_attrs()[RGW_ATTR_ETAG].to_str();
67296729
}
67306730

0 commit comments

Comments
 (0)