diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-22 12:34:39 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-24 21:40:47 +0100 |
commit | daee5ca7c1019ba973a00f5109256f64873b1b13 (patch) | |
tree | 41b1ff71210c7ab0b54bbb8aa1a2b5e2122e69d0 /openbsc | |
parent | a29e43a26fae23d5132461cf7bfa43a1ca64761f (diff) |
subscr: Make it possible to keep subscribers in RAM.
This is implemented by not freeing the subscriber when the
reference count becomes smaller than zero. We hope that this
will save many database accesses during the congres.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 3 | ||||
-rw-r--r-- | openbsc/src/gsm_subscriber_base.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index b9ec94cf9..f42ae1b4a 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -730,6 +730,9 @@ struct gsm_network { /* MSC data in case we are a true BSC */ struct osmo_msc_data *msc_data; int hardcoded_rtp_payload; + + /* subscriber related features */ + int keep_subscr; }; #define SMS_HDR_SIZE 128 diff --git a/openbsc/src/gsm_subscriber_base.c b/openbsc/src/gsm_subscriber_base.c index 3136ebedd..e3a04f343 100644 --- a/openbsc/src/gsm_subscriber_base.c +++ b/openbsc/src/gsm_subscriber_base.c @@ -86,7 +86,7 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr) subscr->use_count--; DEBUGP(DREF, "subscr %s usage decreased usage to: %d\n", subscr->extension, subscr->use_count); - if (subscr->use_count <= 0) + if (subscr->use_count <= 0 && !subscr->net->keep_subscr) subscr_free(subscr); return NULL; } |