From: Samuel Just Date: Thu, 26 Aug 2021 20:48:30 +0000 (+0000) Subject: crimson/tools/store_nbd: add object_info emulation to fs_driver X-Git-Tag: v17.1.0~990^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=efe81ea7deea97a7dc637d4dc47753b778b8d7a7;p=ceph.git crimson/tools/store_nbd: add object_info emulation to fs_driver Signed-off-by: Samuel Just --- diff --git a/src/crimson/tools/store_nbd/block_driver.h b/src/crimson/tools/store_nbd/block_driver.h index d73f0188496a0..54da206cb9551 100644 --- a/src/crimson/tools/store_nbd/block_driver.h +++ b/src/crimson/tools/store_nbd/block_driver.h @@ -30,6 +30,7 @@ public: bool mkfs = false; unsigned num_collections = 128; unsigned object_size = 4<<20 /* 4MB, rbd default */; + unsigned oi_size = 1<<9 /* 512b */; std::optional path; bool is_futurized_store() const { @@ -41,6 +42,10 @@ public: return type; } + bool oi_enabled() const { + return oi_size > 0; + } + void populate_options( boost::program_options::options_description &desc) { @@ -62,6 +67,11 @@ public: po::value() ->notifier([this](auto s) { num_collections = s; }), "Number of collections to use for futurized_store backends" + ("object-info-size", + po::value() + ->notifier([this](auto s) { log_entry_size = s; }), + "Size of each log entry per pg to use for futurized_store backends" + ", 0 to disable" ) ("object-size", po::value() diff --git a/src/crimson/tools/store_nbd/fs_driver.cc b/src/crimson/tools/store_nbd/fs_driver.cc index f720ac0eb1c9d..1f3909ba07b2d 100644 --- a/src/crimson/tools/store_nbd/fs_driver.cc +++ b/src/crimson/tools/store_nbd/fs_driver.cc @@ -47,6 +47,17 @@ seastar::future<> FSDriver::write( ptr.length(), bl, 0); + + if (config.oi_enabled() ) { + bufferlist attr; + attr.append(ceph::buffer::create(config.oi_size, '0')); + t.setattr( + mapping.chandle->get_cid(), + mapping.object, + "_", + attr); + } + return fs->do_transaction( mapping.chandle, std::move(t));