From: J. Eric Ivancich Date: Wed, 30 Jun 2021 19:39:33 +0000 (-0400) Subject: rgw: a small set of clean-ups X-Git-Tag: v17.1.0~1498^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=04fa36a699b1ce7b7dbb447a7fee8c0ad570bb46;p=ceph.git 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 --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index ea16422f51919..cbf55ae86e2f5 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 0eca7345dc650..d95e7d489d939 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 f39919d24b60b..63f7517334488 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 a1800a834b4eb..bf1ba5c5499e4 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 19303120a7530..ccf19c1824ecf 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 d6cd7767a1395..44a5d7b33832b 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 88a042fc945bc..bce510b9c534b 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 5a3d2b1d19eb6..ae33e3ff0e1f7 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 95f791c09b942..22ddbad06d1da 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 da9d08036e6b6..885bf14b99387 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 3f20271933db1..b62e3a8a6098f 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,