]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-all-cell-list-20070619
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Jun 2007 19:29:41 +0000 (19:29 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 19 Jun 2007 19:29:41 +0000 (19:29 +0000)
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.

src/WINNT/afsd/cm_cell.c

index 3197a744755de69ebc56c1c59f50b5a24b62d211..85d6dfb20b3bb0077e775e5c19ac4a647d9aa306 100644 (file)
@@ -225,9 +225,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;