Change in osmo-bsc[master]: cosmetic: bsc_subscr_alloc: log initial get

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu May 24 16:59:48 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9286


Change subject: cosmetic: bsc_subscr_alloc: log initial get
......................................................................

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
---
M src/libbsc/bsc_subscriber.c
M tests/subscr/bsc_subscr_test.err
2 files changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/86/9286/1

diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c
index d9d90ba..65a660b 100644
--- a/src/libbsc/bsc_subscriber.c
+++ b/src/libbsc/bsc_subscriber.c
@@ -41,7 +41,6 @@
 		return NULL;
 
 	llist_add_tail(&bsub->entry, list);
-	bsub->use_count = 1;
 
 	return bsub;
 }
@@ -92,7 +91,7 @@
 		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 @@
 		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)
diff --git a/tests/subscr/bsc_subscr_test.err b/tests/subscr/bsc_subscr_test.err
index a66317a..afc8bf7 100644
--- a/tests/subscr/bsc_subscr_test.err
+++ b/tests/subscr/bsc_subscr_test.err
@@ -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

-- 
To view, visit https://gerrit.osmocom.org/9286
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia72f8010b7b2e1ca44e3b005c0f2c05f3eeae8d5
Gerrit-Change-Number: 9286
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180524/046c2706/attachment.htm>


More information about the gerrit-log mailing list