summaryrefslogtreecommitdiffstats
path: root/src/rgw/driver/posix
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/driver/posix')
-rw-r--r--src/rgw/driver/posix/README.md12
-rw-r--r--src/rgw/driver/posix/notify.h2
-rw-r--r--src/rgw/driver/posix/rgw_sal_posix.cc43
-rw-r--r--src/rgw/driver/posix/rgw_sal_posix.h31
4 files changed, 76 insertions, 12 deletions
diff --git a/src/rgw/driver/posix/README.md b/src/rgw/driver/posix/README.md
index 02dc8dfbe85..73971edc86f 100644
--- a/src/rgw/driver/posix/README.md
+++ b/src/rgw/driver/posix/README.md
@@ -23,15 +23,15 @@ Edit ceph.conf to add below option
rgw config store = dbstore
rgw filter = posix
-Start vstart cluster
+To start the `vstart` cluster, run the following cmd:
- MON=0 OSD=0 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -o rgw_backend_store=dbstore -o rgw_config_store=dbstore -o rgw_filter=posix -n -d
+ MON=0 OSD=0 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -n -d --rgw_store posix
-The above vstart command brings up RGW server on POSIXDriver. It creates default zonegroup, zone and few default users (eg., testid) to be used for s3 operations.
+The above vstart command brings up RGW server on POSIXDriver. It creates default zonegroup, zone and few default users (e.g., testid) to be used for s3 operations.
-`radosgw-admin` can be used to create and remove other users, zonegroups and zones.
+`radosgw-admin` command can be used to create and remove other users, zonegroups and zones.
-By default, the directory exported is *'/tmp/rgw_posix_driver'*. This can be changed with the `rgw_posix_base_path` option, either in ceph.conf or on the vstart command line above.
+By default, the directory exported, *'rgw_posix_driver'*, is created in the `dev` subdirectory. This can be changed with the `rgw_posix_base_path` option.
-The POSIXDriver keeps a LMDB based cache of directories, so that it can provide ordered listings. This directory lives in `rgw_posix_database_root`, which by default is in *'/var/lib/ceph/radosgw'*
+The POSIXDriver keeps a LMDB based cache of directories, so that it can provide ordered listings. This directory lives in `rgw_posix_database_root`, which by default is created in the `dev` subdirectory
diff --git a/src/rgw/driver/posix/notify.h b/src/rgw/driver/posix/notify.h
index 9f6088a893a..4463abc57c2 100644
--- a/src/rgw/driver/posix/notify.h
+++ b/src/rgw/driver/posix/notify.h
@@ -212,7 +212,7 @@ namespace file::listing {
void signal_shutdown() {
uint64_t msg{sig_shutdown};
- (void) write(efd, &msg, sizeof(uint64_t));
+ std::ignore = write(efd, &msg, sizeof(uint64_t));
}
friend class Notify;
diff --git a/src/rgw/driver/posix/rgw_sal_posix.cc b/src/rgw/driver/posix/rgw_sal_posix.cc
index 8ffe4a0d0ca..9d76462baa0 100644
--- a/src/rgw/driver/posix/rgw_sal_posix.cc
+++ b/src/rgw/driver/posix/rgw_sal_posix.cc
@@ -20,6 +20,7 @@
#include <unistd.h>
#include "rgw_multi.h"
#include "include/scope_guard.h"
+#include "common/errno.h"
#define dout_subsys ceph_subsys_rgw
#define dout_context g_ceph_context
@@ -2730,7 +2731,9 @@ int POSIXBucket::rename(const DoutPrefixProvider* dpp, optional_yield y, Object*
int POSIXObject::delete_object(const DoutPrefixProvider* dpp,
optional_yield y,
- uint32_t flags)
+ uint32_t flags,
+ std::list<rgw_obj_index_key>* remove_objs,
+ RGWObjVersionTracker* objv)
{
POSIXBucket *b = static_cast<POSIXBucket*>(get_bucket());
if (!b) {
@@ -2890,6 +2893,14 @@ int POSIXObject::copy_object(const ACLOwner& owner,
return dobj->set_obj_attrs(dpp, &attrs, nullptr, y, rgw::sal::FLAG_LOG_OP);
}
+int POSIXObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
+ int max_parts, int marker, int* next_marker,
+ bool* truncated, list_parts_each_t each_func,
+ optional_yield y)
+{
+ return -EOPNOTSUPP;
+}
+
int POSIXObject::load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh)
{
int ret = stat(dpp);
@@ -3036,6 +3047,22 @@ int POSIXObject::transition_to_cloud(Bucket* bucket,
return -ERR_NOT_IMPLEMENTED;
}
+int POSIXObject::restore_obj_from_cloud(Bucket* bucket,
+ rgw::sal::PlacementTier* tier,
+ rgw_placement_rule& placement_rule,
+ rgw_bucket_dir_entry& o,
+ CephContext* cct,
+ RGWObjTier& tier_config,
+ real_time& mtime,
+ uint64_t olh_epoch,
+ std::optional<uint64_t> days,
+ const DoutPrefixProvider* dpp,
+ optional_yield y,
+ uint32_t flags)
+{
+ return -ERR_NOT_IMPLEMENTED;
+}
+
bool POSIXObject::placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2)
{
return (r1 == r2);
@@ -3505,7 +3532,7 @@ int POSIXObject::POSIXReadOp::get_attr(const DoutPrefixProvider* dpp, const char
int POSIXObject::POSIXDeleteOp::delete_obj(const DoutPrefixProvider* dpp,
optional_yield y, uint32_t flags)
{
- return source->delete_object(dpp, y, flags);
+ return source->delete_object(dpp, y, flags, nullptr, nullptr);
}
int POSIXObject::copy(const DoutPrefixProvider *dpp, optional_yield y,
@@ -3703,7 +3730,8 @@ int POSIXMultipartUpload::complete(const DoutPrefixProvider *dpp,
RGWCompressionInfo& cs_info, off_t& ofs,
std::string& tag, ACLOwner& owner,
uint64_t olh_epoch,
- rgw::sal::Object* target_obj)
+ rgw::sal::Object* target_obj,
+ prefix_map_t& processed_prefixes)
{
char final_etag[CEPH_CRYPTO_MD5_DIGESTSIZE];
char final_etag_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16];
@@ -3852,6 +3880,15 @@ int POSIXMultipartUpload::complete(const DoutPrefixProvider *dpp,
return 0;
}
+int POSIXMultipartUpload::cleanup_orphaned_parts(const DoutPrefixProvider *dpp,
+ CephContext *cct, optional_yield y,
+ const rgw_obj& obj,
+ std::list<rgw_obj_index_key>& remove_objs,
+ prefix_map_t& processed_prefixes)
+{
+ return -ENOTSUP;
+}
+
int POSIXMultipartUpload::get_info(const DoutPrefixProvider *dpp, optional_yield y,
rgw_placement_rule** rule, rgw::sal::Attrs* attrs)
{
diff --git a/src/rgw/driver/posix/rgw_sal_posix.h b/src/rgw/driver/posix/rgw_sal_posix.h
index 5291ba500f9..bf3478ad6ab 100644
--- a/src/rgw/driver/posix/rgw_sal_posix.h
+++ b/src/rgw/driver/posix/rgw_sal_posix.h
@@ -632,7 +632,9 @@ public:
virtual int delete_object(const DoutPrefixProvider* dpp,
optional_yield y,
- uint32_t flags) override;
+ uint32_t flags,
+ std::list<rgw_obj_index_key>* remove_objs,
+ RGWObjVersionTracker* objv) override;
virtual int copy_object(const ACLOwner& owner,
const rgw_user& remote_user,
req_info* info, const rgw_zone_id& source_zone,
@@ -651,6 +653,13 @@ public:
const DoutPrefixProvider* dpp, optional_yield y) override;
virtual RGWAccessControlPolicy& get_acl(void) override { return acls; }
virtual int set_acl(const RGWAccessControlPolicy& acl) override { acls = acl; return 0; }
+
+ /** If multipart, enumerate (a range [marker..marker+[min(max_parts, parts_count-1)] of) parts of the object */
+ virtual int list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
+ int max_parts, int marker, int* next_marker,
+ bool* truncated, list_parts_each_t each_func,
+ optional_yield y) override;
+
virtual int load_obj_state(const DoutPrefixProvider* dpp, optional_yield y, bool follow_olh = true) override;
virtual int set_obj_attrs(const DoutPrefixProvider* dpp, Attrs* setattrs,
Attrs* delattrs, optional_yield y, uint32_t flags) override;
@@ -679,6 +688,18 @@ public:
bool update_object,
const DoutPrefixProvider* dpp,
optional_yield y) override;
+ virtual int restore_obj_from_cloud(Bucket* bucket,
+ rgw::sal::PlacementTier* tier,
+ rgw_placement_rule& placement_rule,
+ rgw_bucket_dir_entry& o,
+ CephContext* cct,
+ RGWObjTier& tier_config,
+ real_time& mtime,
+ uint64_t olh_epoch,
+ std::optional<uint64_t> days,
+ const DoutPrefixProvider* dpp,
+ optional_yield y,
+ uint32_t flags) override;
virtual bool placement_rules_match(rgw_placement_rule& r1, rgw_placement_rule& r2) override;
virtual int dump_obj_layout(const DoutPrefixProvider *dpp, optional_yield y, Formatter* f) override;
virtual int swift_versioning_restore(const ACLOwner& owner, const rgw_user& remote_user, bool& restored,
@@ -879,7 +900,13 @@ public:
RGWCompressionInfo& cs_info, off_t& ofs,
std::string& tag, ACLOwner& owner,
uint64_t olh_epoch,
- rgw::sal::Object* target_obj) override;
+ rgw::sal::Object* target_obj,
+ prefix_map_t& processed_prefixes) override;
+ virtual int cleanup_orphaned_parts(const DoutPrefixProvider *dpp,
+ CephContext *cct, optional_yield y,
+ const rgw_obj& obj,
+ std::list<rgw_obj_index_key>& remove_objs,
+ prefix_map_t& processed_prefixes) override;
virtual int get_info(const DoutPrefixProvider *dpp, optional_yield y,
rgw_placement_rule** rule, rgw::sal::Attrs* attrs) override;