]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/tools/store_nbd: add object_info emulation to fs_driver
authorSamuel Just <sjust@redhat.com>
Thu, 26 Aug 2021 20:48:30 +0000 (20:48 +0000)
committerSamuel Just <sjust@redhat.com>
Fri, 27 Aug 2021 22:41:48 +0000 (15:41 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/tools/store_nbd/block_driver.h
src/crimson/tools/store_nbd/fs_driver.cc

index d73f0188496a0e8380929279615e6abf510a2f6f..54da206cb95519289cd2de3c6bace08b8d20818a 100644 (file)
@@ -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<std::string> 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<unsigned>()
         ->notifier([this](auto s) { num_collections = s; }),
         "Number of collections to use for futurized_store backends"
+       ("object-info-size",
+        po::value<unsigned>()
+        ->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<unsigned>()
index f720ac0eb1c9dd978425ce3e457fc3c2860915b3..1f3909ba07b2db4e32a47864e5ac850cc931d9da 100644 (file)
@@ -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));