mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 23:40:13 +00:00
windows-check-offline-volumes-20080214
LICENSE MIT when checking offline volumes, update the cell vlserver info if required and don't perform a check if there are no servers in the list.
This commit is contained in:
parent
4aad2a7b6b
commit
935c49a2a6
@ -69,7 +69,7 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *hostnamep)
|
||||
* and check to make sure we have a valid set of volume servers
|
||||
* this function must be called with a Write Lock on cm_cellLock
|
||||
*/
|
||||
static cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
|
||||
cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags)
|
||||
{
|
||||
long code = 0;
|
||||
cm_cell_rock_t rock;
|
||||
@ -403,6 +403,7 @@ void cm_InitCell(int newFile, long maxCells)
|
||||
for (cellp = cm_data.allCellsp; cellp; cellp=cellp->allNextp) {
|
||||
lock_InitializeMutex(&cellp->mx, "cm_cell_t mutex");
|
||||
cellp->vlServersp = NULL;
|
||||
cellp->flags |= CM_CELLFLAG_VLSERVER_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,4 +72,6 @@ extern void cm_AddCellToIDHashTable(cm_cell_t * cellp);
|
||||
|
||||
extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep);
|
||||
|
||||
extern cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags);
|
||||
|
||||
#endif /* __CELL_H_ENV_ */
|
||||
|
@ -209,6 +209,9 @@ long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp,
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (cellp->flags & CM_CELLFLAG_VLSERVER_INVALID)
|
||||
cm_UpdateCell(cellp, 0);
|
||||
|
||||
/* now we have volume structure locked and held; make RPC to fill it */
|
||||
osi_Log2(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s", volp->cellp->name, volp->namep);
|
||||
do {
|
||||
@ -1009,7 +1012,15 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
|
||||
lock_ObtainMutex(&volp->mx);
|
||||
|
||||
if (volp->flags & CM_VOLUMEFLAG_RESET) {
|
||||
cm_InitReq(&req);
|
||||
code = cm_UpdateVolume(volp->cellp, cm_rootUserp, &req, volp);
|
||||
if (code == 0)
|
||||
volp->flags &= ~CM_VOLUMEFLAG_RESET;
|
||||
}
|
||||
|
||||
if (volp->rw.ID != 0 && (!volID || volID == volp->rw.ID) &&
|
||||
volp->rw.serversp &&
|
||||
(volp->rw.state == vl_busy || volp->rw.state == vl_offline || volp->rw.state == vl_unknown)) {
|
||||
cm_InitReq(&req);
|
||||
|
||||
@ -1045,6 +1056,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
}
|
||||
|
||||
if (volp->ro.ID != 0 && (!volID || volID == volp->ro.ID) &&
|
||||
volp->ro.serversp &&
|
||||
(volp->ro.state == vl_busy || volp->ro.state == vl_offline || volp->ro.state == vl_unknown)) {
|
||||
cm_InitReq(&req);
|
||||
|
||||
@ -1080,6 +1092,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID)
|
||||
}
|
||||
|
||||
if (volp->bk.ID != 0 && (!volID || volID == volp->bk.ID) &&
|
||||
volp->bk.serversp &&
|
||||
(volp->bk.state == vl_busy || volp->bk.state == vl_offline || volp->bk.state == vl_unknown)) {
|
||||
cm_InitReq(&req);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user