mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
windows-server-find-by-uuid-20090614
LICENSE MIT Add cm_FindServerByUuid(). This function is similar to cm_FindServerByIP() but uses the server's known uuid instead which is constant across multi- homed systems.
This commit is contained in:
parent
571dc5edbe
commit
88ef4fb720
@ -941,6 +941,26 @@ cm_FindServerByIP(afs_uint32 ipaddr, int type)
|
|||||||
return tsp;
|
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 */
|
/* find a server based on its properties */
|
||||||
cm_server_t *cm_FindServer(struct sockaddr_in *addrp, int type)
|
cm_server_t *cm_FindServer(struct sockaddr_in *addrp, int type)
|
||||||
{
|
{
|
||||||
|
@ -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_FindServerByIP(afs_uint32 addr, int type);
|
||||||
|
|
||||||
|
extern cm_server_t * cm_FindServerByUuid(afsUUID* uuid, int type);
|
||||||
|
|
||||||
extern void cm_SetLanAdapterChangeDetected(void);
|
extern void cm_SetLanAdapterChangeDetected(void);
|
||||||
|
|
||||||
extern void cm_RemoveVolumeFromServer(cm_server_t * serverp, afs_uint32 volID);
|
extern void cm_RemoveVolumeFromServer(cm_server_t * serverp, afs_uint32 volID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user