diff --git a/src/box/schema_def.h b/src/box/schema_def.h index 422065b8df7da7bee4031fa57c9efbf472a05e18..34529790d275db9490c7231ed988d49da036f45d 100644 --- a/src/box/schema_def.h +++ b/src/box/schema_def.h @@ -345,6 +345,18 @@ schema_object_name(enum schema_object_type type); const char * schema_entity_name(enum schema_object_type type); +/** + * Check that the space id corresponds to a system space, which means that is + * has a special meaning for tarantool and has predefined insert/remove + * triggers. + */ +static inline bool +space_id_is_system(uint32_t space_id) +{ + return space_id > BOX_SYSTEM_ID_MIN && + space_id < BOX_SYSTEM_ID_MAX; +} + #if defined(__cplusplus) } /* extern "C" */ #endif /* defined(__cplusplus) */ diff --git a/src/box/space.c b/src/box/space.c index 4cea54cc2991853c69b50448f30bc22aa0af9bf9..970b12bcdbb68b33cb07779621019ff59f12c7cb 100644 --- a/src/box/space.c +++ b/src/box/space.c @@ -122,8 +122,7 @@ space_fill_index_map(struct space *space) bool space_is_system(const struct space *space) { - return space->def->id > BOX_SYSTEM_ID_MIN && - space->def->id < BOX_SYSTEM_ID_MAX; + return space_id_is_system(space->def->id); } /** diff --git a/src/box/space.h b/src/box/space.h index a676d610a60eb38f9f61b851df4e5f195ecd94d2..6301ac7cfeeca9466dfc7a97d1eccb0cd20f585f 100644 --- a/src/box/space.h +++ b/src/box/space.h @@ -541,8 +541,7 @@ space_is_vinyl(const struct space *space) } /** - * Check that the space is a system space, which means that is has a special - * meaning for tarantool and has predefined insert/remove triggers. + * Check that the space is a system space, see also `space_id_is_system`. */ bool space_is_system(const struct space *space);