From: Jeffrey Altman Date: Tue, 19 Jun 2007 19:31:10 +0000 (+0000) Subject: DEVEL15-windows-all-cell-list-20070619 X-Git-Tag: openafs-devel-1_5_21~50 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b98212366204eb3bf15dfec70908e81372e11fca;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-all-cell-list-20070619 Reverse the order of the allCellsp list. Append new cells onto the end of the list. This ensures that the workstation cell will always be the first in the list. Adding additional cells will not degrade the performance to the workstation cell. (cherry picked from commit adb83635bbb0c2ed7f549a78e2d9a56baa16b273) --- diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index 025036aea..f97825100 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -227,9 +227,15 @@ cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, afs_uint32 flags) strncpy(cp->name, fullname, CELL_MAXNAMELEN); cp->name[CELL_MAXNAMELEN-1] = '\0'; - /* thread on global list */ - cp->nextp = cm_data.allCellsp; - cm_data.allCellsp = cp; + /* append cell to global list */ + if (cm_data.allCellsp == NULL) { + cm_data.allCellsp = cp; + } else { + for (cp2 = cm_data.allCellsp; cp2->nextp; cp2=cp2->nextp) + ; + cp2->nextp = cp; + } + cp->nextp = NULL; /* the cellID cannot be 0 */ cp->cellID = ++cm_data.currentCells;