|
|
@ -1,5 +1,6 @@
|
|
|
|
#include <errno.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "runtime.h"
|
|
|
|
#include "tenant.h"
|
|
|
|
#include "tenant.h"
|
|
|
|
#include "panic.h"
|
|
|
|
#include "panic.h"
|
|
|
|
|
|
|
|
|
|
|
@ -7,7 +8,7 @@
|
|
|
|
* Tenant Database *
|
|
|
|
* Tenant Database *
|
|
|
|
******************/
|
|
|
|
******************/
|
|
|
|
|
|
|
|
|
|
|
|
struct tenant *tenant_database[TENANT_DATABASE_CAPACITY] = { NULL };
|
|
|
|
struct tenant *tenant_database[RUNTIME_MAX_TENANT_COUNT] = { NULL };
|
|
|
|
size_t tenant_database_count = 0;
|
|
|
|
size_t tenant_database_count = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -18,11 +19,11 @@ size_t tenant_database_count = 0;
|
|
|
|
int
|
|
|
|
int
|
|
|
|
tenant_database_add(struct tenant *tenant)
|
|
|
|
tenant_database_add(struct tenant *tenant)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
assert(tenant_database_count <= TENANT_DATABASE_CAPACITY);
|
|
|
|
assert(tenant_database_count <= RUNTIME_MAX_TENANT_COUNT);
|
|
|
|
|
|
|
|
|
|
|
|
int rc;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
|
|
|
|
if (tenant_database_count == TENANT_DATABASE_CAPACITY) goto err_no_space;
|
|
|
|
if (tenant_database_count == RUNTIME_MAX_TENANT_COUNT) goto err_no_space;
|
|
|
|
tenant_database[tenant_database_count++] = tenant;
|
|
|
|
tenant_database[tenant_database_count++] = tenant;
|
|
|
|
|
|
|
|
|
|
|
|
rc = 0;
|
|
|
|
rc = 0;
|
|
|
|