From: myoungwon oh Date: Thu, 12 May 2022 05:24:37 +0000 (+0900) Subject: seastore: do assert if paddr type is not SEGMENT in add_relative X-Git-Tag: v18.0.0~857^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ff35731e9b5df0965cf204c8d0aab1623f3615e;p=ceph.git seastore: do assert if paddr type is not SEGMENT in add_relative Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index a7ff94ac4945..3bc0b0d923e8 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -684,14 +684,11 @@ struct blk_paddr_t : public paddr_t { paddr_t add_relative(paddr_t o) const { seastore_off_t off; - if (o.get_addr_type() == addr_types_t::SEGMENT) { - // segment addr is allocated when alloc_new_extent is called. - // But, if random block device is used, - // this eventually can be converted to blk addr after submit_record(). - off = o.as_seg_paddr().get_segment_off(); - } else { - off = o.as_blk_paddr().get_block_off(); - } + ceph_assert(o.get_addr_type() == addr_types_t::SEGMENT); + // segment addr is allocated when alloc_new_extent is called. + // But, if random block device is used, + // segment-based relative addr needs to be added to block addr + off = o.as_seg_paddr().get_segment_off(); return add_offset(off); }