cosmetic: bsc_subscr_alloc: log initial get

Instead of silently setting the use count to 1, instead increment with an
explicit bsc_subsct_get(), which then logs the event along with the place that
created the subscriber.

Change-Id: Ia72f8010b7b2e1ca44e3b005c0f2c05f3eeae8d5
This commit is contained in:
Neels Hofmeyr 2018-05-24 18:38:58 +02:00 committed by Harald Welte
parent fb75d109a1
commit d3fff6f532
2 changed files with 5 additions and 3 deletions

View File

@ -41,7 +41,6 @@ static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list)
return NULL;
llist_add_tail(&bsub->entry, list);
bsub->use_count = 1;
return bsub;
}
@ -92,7 +91,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsc_subscr_set_imsi(bsub, imsi);
return bsub;
return bsc_subscr_get(bsub);
}
struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
@ -104,7 +103,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsub->tmsi = tmsi;
return bsub;
return bsc_subscr_get(bsub);
}
const char *bsc_subscr_name(struct bsc_subscr *bsub)

View File

@ -1,5 +1,8 @@
DREF BSC subscr IMSI:1234567890 usage increases to: 1
DREF BSC subscr IMSI:1234567890 usage increases to: 2
DREF BSC subscr IMSI:1234567890 usage decreases to: 1
DREF BSC subscr IMSI:9876543210 usage increases to: 1
DREF BSC subscr IMSI:5656565656 usage increases to: 1
DREF BSC subscr IMSI:1234567890 usage increases to: 2
DREF BSC subscr IMSI:1234567890 usage decreases to: 1
DREF BSC subscr IMSI:9876543210 usage increases to: 2