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 503d85dc52c5eae4151fc1b40ee799f5781dbe73..1881e27aae67a65ee213893986a71d4854171e53 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 3294bb1bd6ed1034d8e6cf2f3e4e5bbdcf5910f7..46721df51d800efbb35e53c170622c4ff02b1e88 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);