From dc00ae6a66fad64fbe5d966d330da4c70938a821 Mon Sep 17 00:00:00 2001 From: Vedansh Bhartia Date: Sun, 16 Jul 2023 10:36:22 +0530 Subject: [PATCH] rgw: Remove logically dead code Signed-off-by: Vedansh Bhartia --- src/rgw/driver/rados/rgw_reshard.cc | 3 --- src/rgw/rgw_sal_dbstore.cc | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/rgw/driver/rados/rgw_reshard.cc b/src/rgw/driver/rados/rgw_reshard.cc index 31eff5312df48..4369bc8a05c8b 100644 --- a/src/rgw/driver/rados/rgw_reshard.cc +++ b/src/rgw/driver/rados/rgw_reshard.cc @@ -1303,9 +1303,6 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid for(auto& entry: entries) { // logshard entries process_entry(entry, max_entries, dpp, y); - if (ret < 0) { - return ret; - } Clock::time_point now = Clock::now(); if (logshard_lock.should_renew(now)) { diff --git a/src/rgw/rgw_sal_dbstore.cc b/src/rgw/rgw_sal_dbstore.cc index df6330552e758..9886bd5b59096 100644 --- a/src/rgw/rgw_sal_dbstore.cc +++ b/src/rgw/rgw_sal_dbstore.cc @@ -1329,7 +1329,6 @@ namespace rgw::sal { rgw_zone_set *zones_trace, bool *canceled, optional_yield y) { - int ret = 0; /* XXX: same as AtomicWriter..consolidate code */ parent_op.meta.mtime = mtime; parent_op.meta.delete_at = delete_at; @@ -1341,9 +1340,6 @@ namespace rgw::sal { /* XXX: handle accounted size */ accounted_size = total_data_size; - if (ret < 0) - return ret; - RGWUploadPartInfo info; info.num = part_num; info.etag = etag; @@ -1354,7 +1350,7 @@ namespace rgw::sal { DB::Object op_target(store->getDB(), meta_obj->get_bucket()->get_info(), meta_obj->get_obj()); - ret = op_target.add_mp_part(dpp, info); + auto ret = op_target.add_mp_part(dpp, info); if (ret < 0) { return ret == -ENOENT ? -ERR_NO_SUCH_UPLOAD : ret; } -- 2.39.5