summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_mynames.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-06-10 19:51:58 +0000
committerChristopher R. Hertel <crh@samba.org>1998-06-10 19:51:58 +0000
commitd4366df039dfd730fe24c95b9ef7d59306f35309 (patch)
treed872bd4ba5aa2aabecadf8d71382ba758aa00928 /source3/nmbd/nmbd_mynames.c
parent72bf410b6e9b85f8fbff7f6175661829bef35f62 (diff)
downloadsamba-d4366df039dfd730fe24c95b9ef7d59306f35309.tar.gz
samba-d4366df039dfd730fe24c95b9ef7d59306f35309.tar.bz2
samba-d4366df039dfd730fe24c95b9ef7d59306f35309.zip
I've replaced the linked list used to manage the subnet namelists with a
splay tree. For short lists, this will have no noticable effect. As lists (eg. the WINS database) grow longer, the speed improvements should be quite dramatic. This change is an incremental step toward replacing the in-memory namelists with a back-end database. This change is going into the 1.9.19pre-alpha code because...well...it's pre-alpha. Please let me know if there are any problems. (Oh, as a side-effect, the wins.dat will be in sorted order. :) Chris -)----- (This used to be commit 7806c453df02a89f67e7c5c8b91f24aa2274e756)
Diffstat (limited to 'source3/nmbd/nmbd_mynames.c')
-rw-r--r--source3/nmbd/nmbd_mynames.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/nmbd/nmbd_mynames.c b/source3/nmbd/nmbd_mynames.c
index f0330c00b7..ba42274165 100644
--- a/source3/nmbd/nmbd_mynames.c
+++ b/source3/nmbd/nmbd_mynames.c
@@ -155,13 +155,15 @@ void release_my_names(void)
{
struct name_record *namerec, *nextnamerec;
- for (namerec = subrec->namelist; namerec; namerec = nextnamerec)
+ for (namerec = (struct name_record *)ubi_trFirst( subrec->namelist );
+ namerec;
+ namerec = nextnamerec)
{
- nextnamerec = namerec->next;
+ nextnamerec = (struct name_record *)ubi_trNext( namerec );
if( (namerec->data.source == SELF_NAME)
&& !NAME_IS_DEREGISTERING(namerec) )
- release_name(subrec, namerec, standard_success_release,
- NULL, NULL);
+ release_name( subrec, namerec, standard_success_release,
+ NULL, NULL);
}
}
}
@@ -178,7 +180,9 @@ void refresh_my_names(time_t t)
{
struct name_record *namerec;
- for (namerec = subrec->namelist; namerec; namerec = namerec->next)
+ for( namerec = (struct name_record *)ubi_trFirst( subrec->namelist );
+ namerec;
+ namerec = (struct name_record *)ubi_trNext( namerec ) )
{
/* Each SELF name has an individual time to be refreshed. */
if( (namerec->data.source == SELF_NAME)