From 04fa36a699b1ce7b7dbb447a7fee8c0ad570bb46 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 30 Jun 2021 15:39:33 -0400 Subject: [PATCH] rgw: a small set of clean-ups Small items noticed along the way and addressed collectively in this small "omnibus" PR. Signed-off-by: J. Eric Ivancich --- src/cls/rgw/cls_rgw.cc | 4 ++-- src/cls/rgw/cls_rgw_client.h | 5 +---- src/cls/rgw/cls_rgw_const.h | 5 +---- src/cls/rgw/cls_rgw_ops.h | 5 +---- src/cls/rgw/cls_rgw_types.h | 5 +---- src/cls/rgw_gc/cls_rgw_gc.cc | 2 -- src/cls/rgw_gc/cls_rgw_gc_client.h | 5 +---- src/cls/rgw_gc/cls_rgw_gc_const.h | 8 ++++---- src/cls/rgw_gc/cls_rgw_gc_ops.h | 4 +--- src/cls/rgw_gc/cls_rgw_gc_types.h | 5 +---- src/rgw/rgw_rados.cc | 2 -- 11 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index ea16422f519..cbf55ae86e2 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -563,7 +563,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out) __func__, key.name.c_str(), key.instance.c_str()); continue; } - + // filter out noncurrent versions, delete markers, and initial marker if (!op.list_versions && (!entry.is_visible() || op.start_obj.name == key.name)) { @@ -3676,7 +3676,7 @@ static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist cls_rgw_gc_list_ret op_ret; #define GC_LIST_ENTRIES_DEFAULT 128 - int ret = gc_list_entries(hctx, op.marker, (op.max ? op.max : GC_LIST_ENTRIES_DEFAULT), op.expired_only, + int ret = gc_list_entries(hctx, op.marker, (op.max ? op.max : GC_LIST_ENTRIES_DEFAULT), op.expired_only, op_ret.entries, &op_ret.truncated, op_ret.next_marker); if (ret < 0) return ret; diff --git a/src/cls/rgw/cls_rgw_client.h b/src/cls/rgw/cls_rgw_client.h index 0eca7345dc6..d95e7d489d9 100644 --- a/src/cls/rgw/cls_rgw_client.h +++ b/src/cls/rgw/cls_rgw_client.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_CLIENT_H -#define CEPH_CLS_RGW_CLIENT_H +#pragma once #include "include/str_list.h" #include "include/rados/librados.hpp" @@ -640,5 +639,3 @@ int cls_rgw_clear_bucket_resharding(librados::IoCtx& io_ctx, const std::string& int cls_rgw_get_bucket_resharding(librados::IoCtx& io_ctx, const std::string& oid, cls_rgw_bucket_instance_entry *entry); #endif - -#endif diff --git a/src/cls/rgw/cls_rgw_const.h b/src/cls/rgw/cls_rgw_const.h index f39919d24b6..63f75173344 100644 --- a/src/cls/rgw/cls_rgw_const.h +++ b/src/cls/rgw/cls_rgw_const.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_CONST_H -#define CEPH_CLS_RGW_CONST_H +#pragma once #define RGW_CLASS "rgw" @@ -71,5 +70,3 @@ #define RGW_CLEAR_BUCKET_RESHARDING "clear_bucket_resharding" #define RGW_GUARD_BUCKET_RESHARDING "guard_bucket_resharding" #define RGW_GET_BUCKET_RESHARDING "get_bucket_resharding" - -#endif diff --git a/src/cls/rgw/cls_rgw_ops.h b/src/cls/rgw/cls_rgw_ops.h index a1800a834b4..bf1ba5c5499 100644 --- a/src/cls/rgw/cls_rgw_ops.h +++ b/src/cls/rgw/cls_rgw_ops.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_OPS_H -#define CEPH_CLS_RGW_OPS_H +#pragma once #include "cls/rgw/cls_rgw_types.h" @@ -1484,5 +1483,3 @@ struct cls_rgw_get_bucket_resharding_ret { void dump(ceph::Formatter *f) const; }; WRITE_CLASS_ENCODER(cls_rgw_get_bucket_resharding_ret) - -#endif /* CEPH_CLS_RGW_OPS_H */ diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h index 19303120a75..ccf19c1824e 100644 --- a/src/cls/rgw/cls_rgw_types.h +++ b/src/cls/rgw/cls_rgw_types.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_TYPES_H -#define CEPH_CLS_RGW_TYPES_H +#pragma once #include #include "common/ceph_time.h" @@ -1283,5 +1282,3 @@ struct cls_rgw_reshard_entry void get_key(std::string *key) const; }; WRITE_CLASS_ENCODER(cls_rgw_reshard_entry) - -#endif diff --git a/src/cls/rgw_gc/cls_rgw_gc.cc b/src/cls/rgw_gc/cls_rgw_gc.cc index d6cd7767a13..44a5d7b3383 100644 --- a/src/cls/rgw_gc/cls_rgw_gc.cc +++ b/src/cls/rgw_gc/cls_rgw_gc.cc @@ -17,8 +17,6 @@ #include "common/ceph_context.h" #include "global/global_context.h" -#define dout_context g_ceph_context -#define dout_subsys ceph_subsys_rgw #define GC_LIST_DEFAULT_MAX 128 diff --git a/src/cls/rgw_gc/cls_rgw_gc_client.h b/src/cls/rgw_gc/cls_rgw_gc_client.h index 88a042fc945..bce510b9c53 100644 --- a/src/cls/rgw_gc/cls_rgw_gc_client.h +++ b/src/cls/rgw_gc/cls_rgw_gc_client.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_GC_CLIENT_H -#define CEPH_CLS_RGW_GC_CLIENT_H +#pragma once #include "include/rados/librados.hpp" @@ -19,5 +18,3 @@ int cls_rgw_gc_queue_list_entries(librados::IoCtx& io_ctx, const std::string& oi std::list& entries, bool *truncated, std::string& next_marker); void cls_rgw_gc_queue_remove_entries(librados::ObjectWriteOperation& op, uint32_t num_entries); void cls_rgw_gc_queue_defer_entry(librados::ObjectWriteOperation& op, uint32_t expiration_secs, const cls_rgw_gc_obj_info& info); - -#endif diff --git a/src/cls/rgw_gc/cls_rgw_gc_const.h b/src/cls/rgw_gc/cls_rgw_gc_const.h index 5a3d2b1d19e..ae33e3ff0e1 100644 --- a/src/cls/rgw_gc/cls_rgw_gc_const.h +++ b/src/cls/rgw_gc/cls_rgw_gc_const.h @@ -1,5 +1,7 @@ -#ifndef CEPH_CLS_RGW_GC_CONSTS_H -#define CEPH_CLS_RGW_GC_CONSTS_H +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#pragma once #define RGW_GC_CLASS "rgw_gc" @@ -8,5 +10,3 @@ #define RGW_GC_QUEUE_LIST_ENTRIES "rgw_gc_queue_list_entries" #define RGW_GC_QUEUE_REMOVE_ENTRIES "rgw_gc_queue_remove_entries" #define RGW_GC_QUEUE_UPDATE_ENTRY "rgw_gc_queue_update_entry" - -#endif \ No newline at end of file diff --git a/src/cls/rgw_gc/cls_rgw_gc_ops.h b/src/cls/rgw_gc/cls_rgw_gc_ops.h index 95f791c09b9..22ddbad06d1 100644 --- a/src/cls/rgw_gc/cls_rgw_gc_ops.h +++ b/src/cls/rgw_gc/cls_rgw_gc_ops.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_GC_OPS_H -#define CEPH_CLS_RGW_GC_OPS_H +#pragma once #include "cls/rgw/cls_rgw_types.h" @@ -68,4 +67,3 @@ struct cls_rgw_gc_queue_defer_entry_op { } }; WRITE_CLASS_ENCODER(cls_rgw_gc_queue_defer_entry_op) -#endif /* CEPH_CLS_RGW_GC_OPS_H */ diff --git a/src/cls/rgw_gc/cls_rgw_gc_types.h b/src/cls/rgw_gc/cls_rgw_gc_types.h index da9d08036e6..885bf14b993 100644 --- a/src/cls/rgw_gc/cls_rgw_gc_types.h +++ b/src/cls/rgw_gc/cls_rgw_gc_types.h @@ -1,8 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#ifndef CEPH_CLS_RGW_GC_TYPES_H -#define CEPH_CLS_RGW_GC_TYPES_H +#pragma once #include "include/types.h" #include @@ -33,5 +32,3 @@ struct cls_rgw_gc_urgent_data } }; WRITE_CLASS_ENCODER(cls_rgw_gc_urgent_data) - -#endif diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3f20271933d..b62e3a8a609 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -107,8 +107,6 @@ static string default_storage_extra_pool_suffix = "rgw.buckets.non-ec"; static RGWObjCategory main_category = RGWObjCategory::Main; #define RGW_USAGE_OBJ_PREFIX "usage." -#define dout_subsys ceph_subsys_rgw - static bool rgw_get_obj_data_pool(const RGWZoneGroup& zonegroup, const RGWZoneParams& zone_params, const rgw_placement_rule& head_placement_rule, -- 2.39.5