From 59907c3532520fd0e2bf3922e1cf4ae16ac7dd56 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Wed, 23 Apr 2025 17:27:04 +0800 Subject: [PATCH] crimson/os/seastore/seastore_types: tolerate fake paddrs as absolute addresses Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/seastore_types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index f797321e1fb56..1d9cfc39563fa 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -643,8 +643,21 @@ public: return get_device_id() == DEVICE_ID_ROOT; } + /** + * is_absolute() + * + * indicates whether addr reflects an absolute location + * which can be found on disk. + * + * Note, fake paddrs should work like the absolute ones. + */ bool is_absolute() const { +#ifdef UNIT_TESTS_BUILT + return get_addr_type() != paddr_types_t::RESERVED || + is_fake(); +#else return get_addr_type() != paddr_types_t::RESERVED; +#endif } bool is_absolute_random_block() const { -- 2.39.5