summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Williamson <jfw@ibm.com>2025-01-08 18:53:07 +0100
committerGitHub <noreply@github.com>2025-01-08 18:53:07 +0100
commitb58fe38da55d2d63689352f20b08d56ab80a48a4 (patch)
tree0e7382fe7fd5b9acc091887af65b7fc8397a8ddb
parentMerge pull request #60379 from cbodley/wip-librados-cancellation (diff)
parentrgw: migrate rgw_admin to new directory. (diff)
downloadceph-b58fe38da55d2d63689352f20b08d56ab80a48a4.tar.xz
ceph-b58fe38da55d2d63689352f20b08d56ab80a48a4.zip
Merge pull request #61074 from chardan/wip-radowsgw-admin-jfw-restructure_file
rgw: migrate rgw_admin to new radosgw-admin directory
-rw-r--r--src/rgw/CMakeLists.txt6
-rw-r--r--src/rgw/driver/rados/rgw_user.h8
-rw-r--r--src/rgw/radosgw-admin/orphan.cc (renamed from src/rgw/rgw_orphan.cc)7
-rw-r--r--src/rgw/radosgw-admin/orphan.h (renamed from src/rgw/rgw_orphan.h)0
-rw-r--r--src/rgw/radosgw-admin/radosgw-admin.cc (renamed from src/rgw/rgw_admin.cc)39
-rw-r--r--src/rgw/radosgw-admin/sync_checkpoint.cc (renamed from src/rgw/rgw_sync_checkpoint.cc)6
-rw-r--r--src/rgw/radosgw-admin/sync_checkpoint.h (renamed from src/rgw/rgw_sync_checkpoint.h)0
7 files changed, 34 insertions, 32 deletions
diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt
index 3727c525ce7..41e473e23f0 100644
--- a/src/rgw/CMakeLists.txt
+++ b/src/rgw/CMakeLists.txt
@@ -487,9 +487,9 @@ target_link_libraries(radosgw PRIVATE
install(TARGETS radosgw DESTINATION bin)
set(radosgw_admin_srcs
- rgw_admin.cc
- rgw_sync_checkpoint.cc
- rgw_orphan.cc)
+ radosgw-admin/radosgw-admin.cc
+ radosgw-admin/sync_checkpoint.cc
+ radosgw-admin/orphan.cc)
# this is unsatisfying and hopefully temporary; ARROW should not be
# part of radosgw_admin
diff --git a/src/rgw/driver/rados/rgw_user.h b/src/rgw/driver/rados/rgw_user.h
index ab157f38e39..4ae7d13eff7 100644
--- a/src/rgw/driver/rados/rgw_user.h
+++ b/src/rgw/driver/rados/rgw_user.h
@@ -19,11 +19,11 @@
#define RGW_USER_ANON_ID "anonymous"
-#define SECRET_KEY_LEN 40
-#define PUBLIC_ID_LEN 20
-#define RAND_SUBUSER_LEN 5
+constexpr auto SECRET_KEY_LEN=40;
+constexpr auto PUBLIC_ID_LEN=20;
+constexpr auto RAND_SUBUSER_LEN=5;
-#define XMLNS_AWS_S3 "http://s3.amazonaws.com/doc/2006-03-01/"
+constexpr auto XMLNS_AWS_S3 = "http://s3.amazonaws.com/doc/2006-03-01/";
class RGWUserCtl;
class RGWBucketCtl;
diff --git a/src/rgw/rgw_orphan.cc b/src/rgw/radosgw-admin/orphan.cc
index b7dc562c721..9fca3b99a7c 100644
--- a/src/rgw/rgw_orphan.cc
+++ b/src/rgw/radosgw-admin/orphan.cc
@@ -1,6 +1,12 @@
+
+/*
+ * Copyright (C) 2024 IBM
+*/
+
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
+#include "radosgw-admin/orphan.h"
#include <string>
@@ -10,7 +16,6 @@
#include "rgw_op.h"
#include "rgw_multi.h"
-#include "rgw_orphan.h"
#include "rgw_zone.h"
#include "rgw_bucket.h"
#include "rgw_sal_rados.h"
diff --git a/src/rgw/rgw_orphan.h b/src/rgw/radosgw-admin/orphan.h
index db811d31d9a..db811d31d9a 100644
--- a/src/rgw/rgw_orphan.h
+++ b/src/rgw/radosgw-admin/orphan.h
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/radosgw-admin/radosgw-admin.cc
index f2c1e81b540..182e42b8e31 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/radosgw-admin/radosgw-admin.cc
@@ -1,12 +1,15 @@
+/*
+ * Copyright (C) 2025 IBM
+*/
+
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#include <errno.h>
-#include <iostream>
-#include <sstream>
+#include <cerrno>
#include <string>
-
-#include <boost/optional.hpp>
+#include <sstream>
+#include <optional>
+#include <iostream>
extern "C" {
#include <liboath/oath.h>
@@ -38,6 +41,9 @@ extern "C" {
#include "include/utime.h"
#include "include/str_list.h"
+#include "radosgw-admin/orphan.h"
+#include "radosgw-admin/sync_checkpoint.h"
+
#include "rgw_user.h"
#include "rgw_otp.h"
#include "rgw_rados.h"
@@ -48,7 +54,6 @@ extern "C" {
#include "rgw_log.h"
#include "rgw_formats.h"
#include "rgw_usage.h"
-#include "rgw_orphan.h"
#include "rgw_sync.h"
#include "rgw_trim_bilog.h"
#include "rgw_trim_datalog.h"
@@ -62,7 +67,6 @@ extern "C" {
#include "rgw_zone.h"
#include "rgw_pubsub.h"
#include "rgw_bucket_sync.h"
-#include "rgw_sync_checkpoint.h"
#include "rgw_lua.h"
#include "rgw_sal.h"
#include "rgw_sal_config.h"
@@ -82,11 +86,6 @@ extern "C" {
#define dout_context g_ceph_context
-#define SECRET_KEY_LEN 40
-#define PUBLIC_ID_LEN 20
-
-using namespace std;
-
static rgw::sal::Driver* driver = NULL;
static constexpr auto dout_subsys = ceph_subsys_rgw;
@@ -117,19 +116,13 @@ static const DoutPrefixProvider* dpp() {
} \
} while (0)
-static inline int posix_errortrans(int r)
+using namespace std;
+
+inline int posix_errortrans(int r)
{
- switch(r) {
- case ERR_NO_SUCH_BUCKET:
- r = ENOENT;
- break;
- default:
- break;
- }
- return r;
+ return ERR_NO_SUCH_BUCKET == r ? ENOENT : r;
}
-
static const std::string LUA_CONTEXT_LIST("prerequest, postrequest, background, getdata, putdata");
void usage()
@@ -1272,7 +1265,7 @@ static int read_input(const string& infile, bufferlist& bl)
}
}
-#define READ_CHUNK 8196
+ constexpr auto READ_CHUNK=8196;
int r;
int err;
diff --git a/src/rgw/rgw_sync_checkpoint.cc b/src/rgw/radosgw-admin/sync_checkpoint.cc
index 1172e79a48f..0303ed6c747 100644
--- a/src/rgw/rgw_sync_checkpoint.cc
+++ b/src/rgw/radosgw-admin/sync_checkpoint.cc
@@ -5,6 +5,7 @@
* Ceph - scalable distributed file system
*
* Copyright (C) 2020 Red Hat, Inc.
+ * Copyright (C) 2024 IBM
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +14,12 @@
*
*/
+#include "radosgw-admin/sync_checkpoint.h"
+
#include <fmt/format.h>
+
#include "common/errno.h"
-#include "rgw_sync_checkpoint.h"
+
#include "rgw_sal_rados.h"
#include "rgw_bucket_sync.h"
#include "rgw_data_sync.h"
diff --git a/src/rgw/rgw_sync_checkpoint.h b/src/rgw/radosgw-admin/sync_checkpoint.h
index 28df68d8860..28df68d8860 100644
--- a/src/rgw/rgw_sync_checkpoint.h
+++ b/src/rgw/radosgw-admin/sync_checkpoint.h