Skip to content

Commit 59907c3

Browse files
committed
crimson/os/seastore/seastore_types: tolerate fake paddrs as absolute addresses
Signed-off-by: Yingxin Cheng <[email protected]>
1 parent 9491e1b commit 59907c3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/crimson/os/seastore/seastore_types.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,21 @@ struct paddr_t {
643643
return get_device_id() == DEVICE_ID_ROOT;
644644
}
645645

646+
/**
647+
* is_absolute()
648+
*
649+
* indicates whether addr reflects an absolute location
650+
* which can be found on disk.
651+
*
652+
* Note, fake paddrs should work like the absolute ones.
653+
*/
646654
bool is_absolute() const {
655+
#ifdef UNIT_TESTS_BUILT
656+
return get_addr_type() != paddr_types_t::RESERVED ||
657+
is_fake();
658+
#else
647659
return get_addr_type() != paddr_types_t::RESERVED;
660+
#endif
648661
}
649662

650663
bool is_absolute_random_block() const {

0 commit comments

Comments
 (0)