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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Jun 8 16:16:45 UTC 2018


Harald Welte has submitted this change and it was merged. ( 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/osmo-bsc/bsc_subscriber.c
M tests/subscr/bsc_subscr_test.err
2 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bsc_subscriber.c b/src/osmo-bsc/bsc_subscriber.c
index d9d90ba..65a660b 100644
--- a/src/osmo-bsc/bsc_subscriber.c
+++ b/src/osmo-bsc/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: merged
Gerrit-Change-Id: Ia72f8010b7b2e1ca44e3b005c0f2c05f3eeae8d5
Gerrit-Change-Number: 9286
Gerrit-PatchSet: 8
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180608/1c294a20/attachment.htm>


More information about the gerrit-log mailing list