diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index a7aea335de..68fa4b4e10 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -941,6 +941,26 @@ cm_FindServerByIP(afs_uint32 ipaddr, int type) return tsp; } +cm_server_t * +cm_FindServerByUuid(afsUUID *serverUuid, int type) +{ + cm_server_t *tsp; + + lock_ObtainRead(&cm_serverLock); + for (tsp = cm_allServersp; tsp; tsp = tsp->allNextp) { + if (tsp->type == type && !afs_uuid_equal(&tsp->uuid, serverUuid)) + break; + } + + /* bump ref count if we found the server */ + if (tsp) + cm_GetServerNoLock(tsp); + + lock_ReleaseRead(&cm_serverLock); + + return tsp; +} + /* find a server based on its properties */ cm_server_t *cm_FindServer(struct sockaddr_in *addrp, int type) { diff --git a/src/WINNT/afsd/cm_server.h b/src/WINNT/afsd/cm_server.h index 61a7d8a0e3..12f42077e3 100644 --- a/src/WINNT/afsd/cm_server.h +++ b/src/WINNT/afsd/cm_server.h @@ -128,6 +128,8 @@ extern void cm_SetServerNoInlineBulk(cm_server_t * serverp, int no); extern cm_server_t * cm_FindServerByIP(afs_uint32 addr, int type); +extern cm_server_t * cm_FindServerByUuid(afsUUID* uuid, int type); + extern void cm_SetLanAdapterChangeDetected(void); extern void cm_RemoveVolumeFromServer(cm_server_t * serverp, afs_uint32 volID);