]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #41041 from myoungwon/wip-randomblockmanager-part1
authorSamuel Just <sjust@redhat.com>
Wed, 16 Jun 2021 07:29:18 +0000 (00:29 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Jun 2021 07:29:18 +0000 (00:29 -0700)
seastore: RandomBlockManager part1

Reviewed-by: Samuel Just <sjust@redhat.com>
1  2 
src/crimson/os/seastore/seastore_types.h

index c2bd7d3cbef8fe209b3c9be638b10db8fb9f1473,46383168cc38cee1cb58ccac4548bf0c76c19cf7..5a7a11a5f252f42d2346de6b09ddb5faff969e65
@@@ -672,27 -669,24 +674,43 @@@ struct __attribute__((packed)) root_t 
    void adjust_addrs_from_base(paddr_t base) {
      lba_root.adjust_addrs_from_base(base);
    }
 +
 +  meta_t get_meta() {
 +    bufferlist bl;
 +    bl.append(ceph::buffer::create_static(MAX_META_LENGTH, meta));
 +    meta_t ret;
 +    auto iter = bl.cbegin();
 +    decode(ret, iter);
 +    return ret;
 +  }
 +
 +  void set_meta(const meta_t &m) {
 +    ceph::bufferlist bl;
 +    encode(m, bl);
 +    ceph_assert(bl.length() < MAX_META_LENGTH);
 +    bl.rebuild();
 +    auto &bptr = bl.front();
 +    ::memset(meta, 0, MAX_META_LENGTH);
 +    ::memcpy(meta, bptr.c_str(), bl.length());
 +  }
  };
  
+ using blk_id_t = uint64_t;
+ constexpr blk_id_t NULL_BLK_ID =
+   std::numeric_limits<blk_id_t>::max();
+ // use absolute address
+ using blk_paddr_t = uint64_t;
+ struct rbm_alloc_delta_t {
+   enum class op_types_t : uint8_t {
+     SET = 1,
+     CLEAR = 2
+   };
+   extent_types_t type;
+   interval_set<blk_id_t> alloc_blk_ids;
+   op_types_t op;
+ };
  }
  
  WRITE_CLASS_DENC_BOUNDED(crimson::os::seastore::seastore_meta_t)