2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afs/param.h>
11 #include <afs/afs_args.h>
18 #include <sys/socket.h>
28 /*extern void afsi_log(char *pattern, ...);*/
30 /* read/write lock for all global storage in this module */
31 osi_rwlock_t cm_callbackLock;
33 #ifdef AFS_FREELANCE_CLIENT
34 extern osi_mutex_t cm_Freelance_Lock;
37 /* count of # of callback breaking messages received by this CM so far. We use
38 * this count in determining whether there have been any callback breaks that
39 * apply to a call that returned a new callback. If the counter doesn't
40 * increase during a call, then we know that no callbacks were broken during
41 * that call, and thus that the callback that was just returned is still valid.
43 long cm_callbackCount;
45 /* count of number of RPCs potentially returning a callback executing now.
46 * When this counter hits zero, we can clear out the racing revokes list, since
47 * at that time, we know that none of the just-executed callback revokes will
48 * apply to any future call that returns a callback (since the latter hasn't
49 * even started execution yet).
51 long cm_activeCallbackGrantingCalls;
53 /* list of callbacks that have been broken recently. If a call returning a
54 * callback is executing and a callback revoke runs immediately after it at the
55 * server, the revoke may end up being processed before the response to the
56 * original callback granting call. We detect this by keeping a list of
57 * callback revokes that have been received since we *started* the callback
58 * granting call, and discarding any callbacks received for the same file ID,
59 * even if the callback revoke was received before the callback grant.
61 cm_racingRevokes_t *cm_racingRevokesp;
63 /* record a (potentially) racing revoke for this file ID; null means for all
64 * file IDs, and is used by InitCallBackState.
66 * The cancelFlags describe whether we're just discarding callbacks for the same
67 * file ID, the same volume, or all from the same server.
69 * Called with no locks held.
71 void cm_RecordRacingRevoke(cm_fid_t *fidp, long cancelFlags)
73 cm_racingRevokes_t *rp;
75 lock_ObtainWrite(&cm_callbackLock);
76 if (cm_activeCallbackGrantingCalls > 0) {
77 rp = malloc(sizeof(*rp));
78 memset(rp, 0, sizeof(*rp));
79 osi_QAdd((osi_queue_t **) &cm_racingRevokesp, &rp->q);
80 rp->flags |= (cancelFlags & CM_RACINGFLAG_ALL);
81 if (fidp) rp->fid = *fidp;
82 rp->callbackCount = ++cm_callbackCount;
84 lock_ReleaseWrite(&cm_callbackLock);
88 * When we lose a callback, may have to send change notification replies.
90 void cm_CallbackNotifyChange(cm_scache_t *scp)
92 if (scp->fileType == CM_SCACHETYPE_DIRECTORY) {
93 if (scp->flags & CM_SCACHEFLAG_ANYWATCH)
95 FILE_NOTIFY_GENERIC_DIRECTORY_FILTER,
96 scp, NULL, NULL, TRUE);
101 tfid.cell = scp->fid.cell;
102 tfid.volume = scp->fid.volume;
103 tfid.vnode = scp->parentVnode;
104 tfid.unique = scp->parentUnique;
105 dscp = cm_FindSCache(&tfid);
107 dscp->flags & CM_SCACHEFLAG_ANYWATCH)
109 FILE_NOTIFY_GENERIC_FILE_FILTER,
110 dscp, NULL, NULL, TRUE);
111 if (dscp) cm_ReleaseSCache(dscp);
115 /* called with no locks held for every file ID that is revoked directly by
116 * a callback revoke call. Does not have to handle volume callback breaks,
117 * since those have already been split out.
119 * The callp parameter is currently unused.
121 void cm_RevokeCallback(struct rx_call *callp, AFSFid *fidp)
127 /* don't bother setting cell, since we won't be checking it (to aid
128 * in working with multi-homed servers: we don't know the cell if we
129 * don't recognize the IP address).
132 tfid.volume = fidp->Volume;
133 tfid.vnode = fidp->Vnode;
134 tfid.unique = fidp->Unique;
135 hash = CM_SCACHE_HASH(&tfid);
137 osi_Log3(afsd_logp, "Revoke callback vol %d vn %d un %d",
138 fidp->Volume, fidp->Vnode, fidp->Unique);
140 /* do this first, so that if we're executing a callback granting call
141 * at this moment, we kill it before it can be merged in. Otherwise,
142 * it could complete while we're doing the scan below, and get missed
143 * by both the scan and by this code.
145 cm_RecordRacingRevoke(&tfid, 0);
147 lock_ObtainWrite(&cm_scacheLock);
148 /* do all in the hash bucket, since we don't know how many we'll find with
151 for(scp = cm_hashTablep[hash]; scp; scp=scp->nextp) {
152 if (scp->fid.volume == tfid.volume &&
153 scp->fid.vnode == tfid.vnode &&
154 scp->fid.unique == tfid.unique) {
156 lock_ReleaseWrite(&cm_scacheLock);
157 osi_Log1(afsd_logp, "Revoke scp %x", scp);
158 lock_ObtainMutex(&scp->mx);
159 cm_DiscardSCache(scp);
160 lock_ReleaseMutex(&scp->mx);
161 cm_CallbackNotifyChange(scp);
162 lock_ObtainWrite(&cm_scacheLock);
166 lock_ReleaseWrite(&cm_scacheLock);
169 /* called to revoke a volume callback, which is typically issued when a volume
170 * is moved from one server to another.
172 * Called with no locks held.
174 void cm_RevokeVolumeCallback(struct rx_call *callp, AFSFid *fidp)
180 /* do this first, so that if we're executing a callback granting call
181 * at this moment, we kill it before it can be merged in. Otherwise,
182 * it could complete while we're doing the scan below, and get missed
183 * by both the scan and by this code.
185 tfid.cell = tfid.vnode = tfid.unique = 0;
186 tfid.volume = fidp->Volume;
187 cm_RecordRacingRevoke(&tfid, CM_RACINGFLAG_CANCELVOL);
189 osi_Log1(afsd_logp, "Revoke Volume %d", fidp->Volume);
191 lock_ObtainWrite(&cm_scacheLock);
192 for(hash = 0; hash < cm_hashTableSize; hash++) {
193 for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
194 if (scp->fid.volume == fidp->Volume) {
196 lock_ReleaseWrite(&cm_scacheLock);
197 lock_ObtainMutex(&scp->mx);
198 cm_DiscardSCache(scp);
199 lock_ReleaseMutex(&scp->mx);
200 cm_CallbackNotifyChange(scp);
201 lock_ObtainWrite(&cm_scacheLock);
204 } /* search one hash bucket */
205 } /* search all hash buckets */
207 lock_ReleaseWrite(&cm_scacheLock);
210 /* handle incoming RPC callback breaking message.
211 * Called with no locks held.
213 SRXAFSCB_CallBack(struct rx_call *callp, AFSCBFids *fidsArrayp, AFSCBs *cbsArrayp)
218 for(i=0; i < (long) fidsArrayp->AFSCBFids_len; i++) {
219 tfidp = &fidsArrayp->AFSCBFids_val[i];
221 if (tfidp->Volume == 0) continue; /* means don't do anything */
222 else if (tfidp->Vnode == 0)
223 cm_RevokeVolumeCallback(callp, tfidp);
224 else cm_RevokeCallback(callp, tfidp);
230 /* called with no locks by RPC system when a server indicates that it has never
231 * heard from us, or for other reasons has had to discard callbacks from us
232 * without telling us, e.g. a network partition.
234 SRXAFSCB_InitCallBackState(struct rx_call *callp)
236 struct sockaddr_in taddr;
242 if ((rx_ConnectionOf(callp)) && (rx_PeerOf(rx_ConnectionOf(callp)))) {
243 taddr.sin_family = AF_INET;
244 taddr.sin_addr.s_addr = rx_HostOf(rx_PeerOf(rx_ConnectionOf(callp)));
246 tsp = cm_FindServer(&taddr, CM_SERVER_FILE);
248 osi_Log1(afsd_logp, "Init Callback State server %x", tsp);
250 /* record the callback in the racing revokes structure. This
251 * shouldn't be necessary, since we shouldn't be making callback
252 * granting calls while we're going to get an initstate call,
253 * but there probably are some obscure races, so better safe
256 * We do this first since we don't hold the cm_scacheLock and vnode
257 * locks over the entire callback scan operation below. The
258 * big loop below is guaranteed to hit any callback already
259 * processed. The call to RecordRacingRevoke is guaranteed
260 * to kill any callback that is currently being returned.
261 * Anything that sneaks past both must start
262 * after the call to RecordRacingRevoke.
264 cm_RecordRacingRevoke(NULL, CM_RACINGFLAG_CANCELALL);
266 /* now search all vnodes looking for guys with this callback, if we
267 * found it, or guys with any callbacks, if we didn't find the server
268 * (that's how multihomed machines will appear and how we'll handle
269 * them, albeit a little inefficiently). That is, we're discarding all
270 * callbacks from all hosts if we get an initstate call from an unknown
271 * host. Since these calls are rare, and multihomed servers
272 * are "rare," hopefully this won't be a problem.
274 lock_ObtainWrite(&cm_scacheLock);
275 for(hash = 0; hash < cm_hashTableSize; hash++) {
276 for(scp=cm_hashTablep[hash]; scp; scp=scp->nextp) {
278 lock_ReleaseWrite(&cm_scacheLock);
279 lock_ObtainMutex(&scp->mx);
281 if (scp->cbServerp != NULL) {
282 /* we have a callback, now decide if we should clear it */
283 if (scp->cbServerp == tsp || tsp == NULL) {
284 cm_DiscardSCache(scp);
288 lock_ReleaseMutex(&scp->mx);
290 cm_CallbackNotifyChange(scp);
291 lock_ObtainWrite(&cm_scacheLock);
293 } /* search one hash bucket */
294 } /* search all hash buckets */
296 lock_ReleaseWrite(&cm_scacheLock);
298 /* we're done with the server structure */
299 if (tsp) cm_PutServer(tsp);
305 /* just returns if we're up */
306 SRXAFSCB_Probe(struct rx_call *callp)
311 /* debug interface: not implemented */
312 SRXAFSCB_GetCE64(struct rx_call *callp, long index, AFSDBCacheEntry *cep)
318 /* debug interface: not implemented */
319 SRXAFSCB_GetLock(struct rx_call *callp, long index, AFSDBLock *lockp)
325 /* debug interface: not implemented */
326 SRXAFSCB_GetCE(struct rx_call *callp, long index, AFSDBCacheEntry *cep)
332 /* debug interface: not implemented */
333 SRXAFSCB_XStatsVersion(struct rx_call *callp, long *vp)
340 /* debug interface: not implemented */
341 SRXAFSCB_GetXStats(struct rx_call *callp, long cvn, long coln, long *srvp, long *timep,
342 AFSCB_CollData *datap)
348 /* debug interface: not implemented */
349 SRXAFSCB_InitCallBackState2(struct rx_call *callp, struct interfaceAddr* addr)
355 /* debug interface: not implemented */
356 SRXAFSCB_WhoAreYou(struct rx_call *callp, struct interfaceAddr* addr)
362 /* debug interface: not implemented */
363 SRXAFSCB_InitCallBackState3(struct rx_call *callp, afsUUID* serverUuid)
369 /* debug interface: not implemented */
370 SRXAFSCB_ProbeUuid(struct rx_call *callp, afsUUID* clientUuid)
376 /*------------------------------------------------------------------------
377 * EXPORTED SRXAFSCB_GetServerPrefs
380 * Routine to list server preferences used by this client.
383 * a_call : Ptr to Rx call on which this request came in.
384 * a_index : Input server index
385 * a_srvr_addr : Output server address (0xffffffff on last server)
386 * a_srvr_rank : Output server rank
392 * Nothing interesting.
396 *------------------------------------------------------------------------*/
398 int SRXAFSCB_GetServerPrefs(
399 struct rx_call *a_call,
401 afs_int32 *a_srvr_addr,
402 afs_int32 *a_srvr_rank)
404 *a_srvr_addr = 0xffffffff;
405 *a_srvr_rank = 0xffffffff;
409 /*------------------------------------------------------------------------
410 * EXPORTED SRXAFSCB_GetCellServDB
413 * Routine to list cells configured for this client
416 * a_call : Ptr to Rx call on which this request came in.
417 * a_index : Input cell index
418 * a_name : Output cell name ("" on last cell)
419 * a_hosts : Output cell database servers
425 * Nothing interesting.
429 *------------------------------------------------------------------------*/
431 int SRXAFSCB_GetCellServDB(
432 struct rx_call *a_call,
439 t_name = (char *)malloc(AFSNAMEMAX);
442 a_hosts->serverList_len = 0;
446 /*------------------------------------------------------------------------
447 * EXPORTED SRXAFSCB_GetLocalCell
450 * Routine to return name of client's local cell
453 * a_call : Ptr to Rx call on which this request came in.
454 * a_name : Output cell name
460 * Nothing interesting.
464 *------------------------------------------------------------------------*/
466 int SRXAFSCB_GetLocalCell(
467 struct rx_call *a_call,
473 t_name = (char *)malloc(strlen(cm_rootCellp->namep)+1);
474 strcpy(t_name, cm_rootCellp->namep);
476 t_name = (char *)malloc(1);
485 * afs_MarshallCacheConfig - marshall client cache configuration
489 * IN callerVersion - the rpc stat version of the caller.
491 * IN config - client cache configuration.
493 * OUT ptr - buffer where configuration is marshalled.
499 static void afs_MarshallCacheConfig(
500 afs_uint32 callerVersion,
501 cm_initparams_v1 *config,
505 * We currently only support version 1.
507 *(ptr++) = config->nChunkFiles;
508 *(ptr++) = config->nStatCaches;
509 *(ptr++) = config->nDataCaches;
510 *(ptr++) = config->nVolumeCaches;
511 *(ptr++) = config->firstChunkSize;
512 *(ptr++) = config->otherChunkSize;
513 *(ptr++) = config->cacheSize;
514 *(ptr++) = config->setTime;
515 *(ptr++) = config->memCache;
520 /*------------------------------------------------------------------------
521 * EXPORTED SRXAFSCB_GetCacheConfig
524 * Routine to return parameters used to initialize client cache.
525 * Client may request any format version. Server may not return
526 * format version greater than version requested by client.
529 * a_call: Ptr to Rx call on which this request came in.
530 * callerVersion: Data format version desired by the client.
531 * serverVersion: Data format version of output data.
532 * configCount: Number bytes allocated for output data.
533 * config: Client cache configuration.
539 * Nothing interesting.
543 *------------------------------------------------------------------------*/
545 int SRXAFSCB_GetCacheConfig(a_call, callerVersion, serverVersion,
547 struct rx_call *a_call;
548 afs_uint32 callerVersion;
549 afs_uint32 *serverVersion;
550 afs_uint32 *configCount;
553 afs_uint32 *t_config;
555 extern cm_initparams_v1 cm_initParams;
558 * Currently only support version 1
560 allocsize = sizeof(cm_initparams_v1);
561 t_config = (afs_uint32 *)malloc(allocsize);
563 afs_MarshallCacheConfig(callerVersion, &cm_initParams, t_config);
565 *serverVersion = AFS_CLIENT_RETRIEVAL_FIRST_EDITION;
566 *configCount = allocsize;
567 config->cacheConfig_val = t_config;
568 config->cacheConfig_len = allocsize/sizeof(afs_uint32);
573 /* called by afsd without any locks to initialize this module */
574 void cm_InitCallback(void)
576 lock_InitializeRWLock(&cm_callbackLock, "cm_callbackLock");
577 cm_activeCallbackGrantingCalls = 0;
580 /* called with locked scp; tells us whether we've got a callback.
581 * Expirations are checked by a background daemon so as to make
582 * this function as inexpensive as possible
584 int cm_HaveCallback(cm_scache_t *scp)
586 #ifdef AFS_FREELANCE_CLIENT
587 // yj: we handle callbacks specially for callbacks on the root directory
588 // Since it's local, we almost always say that we have callback on it
589 // The only time we send back a 0 is if we're need to initialize or
590 // reinitialize the fake directory
592 // There are 2 state variables cm_fakeGettingCallback and cm_fakeDirCallback
593 // cm_fakeGettingCallback is 1 if we're in the process of initialization and
594 // hence should return false. it's 0 otherwise
595 // cm_fakeDirCallback is 0 if we haven't loaded the fake directory, it's 1
596 // if the fake directory is loaded and this is the first time cm_HaveCallback
597 // is called since then. We return false in this case to allow cm_GetCallback
598 // to be called because cm_GetCallback has some initialization work to do.
599 // If cm_fakeDirCallback is 2, then it means that the fake directory is in
600 // good shape and we simply return true, provided no change is detected.
603 if (cm_freelanceEnabled &&
604 scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
605 scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) { // if it's something on /afs
606 if (!(scp->fid.vnode==0x1 && scp->fid.unique==0x1)) // if it's not root.afs
609 lock_ObtainMutex(&cm_Freelance_Lock);
610 fdc = cm_fakeDirCallback;
611 fgc = cm_fakeGettingCallback;
612 lock_ReleaseMutex(&cm_Freelance_Lock);
614 if (fdc==1) { // first call since init
616 } else if (fdc==2 && !fgc) { // we're in good shape
617 if (cm_getLocalMountPointChange()) { // check for changes
618 cm_clearLocalMountPointChange(); // clear the changefile
619 cm_reInitLocalMountPoints(); // start reinit
622 return 1; // no change
629 if (scp->cbServerp != NULL)
634 /* need to detect a broken callback that races with our obtaining a callback.
635 * Need to be able to do this even if we don't know the file ID of the file
636 * we're breaking the callback on at the time we start the acquisition of the
637 * callback (as in the case where we are creating a file).
639 * So, we start by writing down the count of the # of callbacks we've received
640 * so far, and bumping a global counter of the # of callback granting calls
641 * outstanding (all done under cm_callbackLock).
643 * When we're back from the call, we look at all of the callback revokes with
644 * counter numbers greater than the one we recorded in our caller's structure,
645 * and replay those that are higher than when we started the call.
647 * We free all the structures in the queue when the count of the # of outstanding
648 * callback-granting calls drops to zero.
650 * We call this function with the scp locked, too, but in its current implementation,
651 * this knowledge is not used.
653 void cm_StartCallbackGrantingCall(cm_scache_t *scp, cm_callbackRequest_t *cbrp)
655 lock_ObtainWrite(&cm_callbackLock);
656 cbrp->callbackCount = cm_callbackCount;
657 cm_activeCallbackGrantingCalls++;
658 cbrp->startTime = osi_Time();
659 cbrp->serverp = NULL;
660 lock_ReleaseWrite(&cm_callbackLock);
663 /* Called at the end of a callback-granting call, to remove the callback
664 * info from the scache entry, if necessary.
666 * Called with scp locked, so we can discard the callbacks easily with
667 * this locking hierarchy.
669 void cm_EndCallbackGrantingCall(cm_scache_t *scp, cm_callbackRequest_t *cbrp,
670 AFSCallBack *cbp, long flags)
672 cm_racingRevokes_t *revp; /* where we are */
673 cm_racingRevokes_t *nrevp; /* where we'll be next */
676 lock_ObtainWrite(&cm_callbackLock);
677 if (flags & CM_CALLBACK_MAINTAINCOUNT) {
678 osi_assert(cm_activeCallbackGrantingCalls > 0);
681 osi_assert(cm_activeCallbackGrantingCalls-- > 0);
683 if (cm_activeCallbackGrantingCalls == 0) freeFlag = 1;
686 /* record the callback; we'll clear it below if we really lose it */
688 scp->cbServerp = cbrp->serverp;
689 scp->cbExpires = cbrp->startTime + cbp->ExpirationTime;
692 /* a callback was actually revoked during our granting call, so
693 * run down the list of revoked fids, looking for ours.
694 * If activeCallbackGrantingCalls is zero, free the elements, too.
696 * May need to go through entire list just to do the freeing.
698 for(revp = cm_racingRevokesp; revp; revp = nrevp) {
699 nrevp = (cm_racingRevokes_t *) osi_QNext(&revp->q);
700 /* if this callback came in later than when we started the
701 * callback-granting call, and if this fid is the right fid,
702 * then clear the callback.
704 if (scp && cbrp->callbackCount != cm_callbackCount
705 && revp->callbackCount > cbrp->callbackCount
707 (scp->fid.volume == revp->fid.volume &&
708 scp->fid.vnode == revp->fid.vnode &&
709 scp->fid.unique == revp->fid.unique)
711 ((revp->flags & CM_RACINGFLAG_CANCELVOL) &&
712 scp->fid.volume == revp->fid.volume)
714 (revp->flags & CM_RACINGFLAG_CANCELALL))) {
715 /* this one matches */
717 "Racing revoke scp %x old cbc %d rev cbc %d cur cbc %d",
719 cbrp->callbackCount, revp->callbackCount,
721 cm_DiscardSCache(scp);
723 * Since we don't have a callback to preserve, it's
724 * OK to drop the lock and re-obtain it.
726 lock_ReleaseMutex(&scp->mx);
727 cm_CallbackNotifyChange(scp);
728 lock_ObtainMutex(&scp->mx);
730 if (freeFlag) free(revp);
733 /* if we freed the list, zap the pointer to it */
734 if (freeFlag) cm_racingRevokesp = NULL;
736 lock_ReleaseWrite(&cm_callbackLock);
739 /* if flags is 1, we want to force the code to make one call, anyway.
740 * called with locked scp; returns with same.
742 long cm_GetCallback(cm_scache_t *scp, struct cm_user *userp,
743 struct cm_req *reqp, long flags)
747 AFSFetchStatus afsStatus;
749 AFSCallBack callback;
751 cm_callbackRequest_t cbr;
756 #ifdef AFS_FREELANCE_CLIENT
758 // The case where a callback is needed on /afs is handled
759 // specially. We need to fetch the status by calling
760 // cm_MergeStatus and mark that cm_fakeDirCallback is 2
761 if (cm_freelanceEnabled &&
762 scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
763 scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
764 scp->fid.unique==0x1 &&
765 scp->fid.vnode==0x1) {
766 // Start by indicating that we're in the process
767 // of fetching the callback
769 lock_ObtainMutex(&cm_Freelance_Lock);
770 cm_fakeGettingCallback = 1;
771 lock_ReleaseMutex(&cm_Freelance_Lock);
773 // Fetch the status info
774 cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0);
776 // Indicate that the callback is not done
777 lock_ObtainMutex(&cm_Freelance_Lock);
778 cm_fakeDirCallback = 2;
779 // Indicate that we're no longer fetching the callback
780 cm_fakeGettingCallback = 0;
781 lock_ReleaseMutex(&cm_Freelance_Lock);
786 if (scp->fid.cell==0x1 && scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) {
787 osi_Log0(afsd_logp,"cm_getcallback should NEVER EVER get here... ");
789 // yj: end of getcallback modifications ---------------
791 #endif /* AFS_FREELANCE_CLIENT */
793 mustCall = (flags & 1);
794 cm_AFSFidFromFid(&tfid, &scp->fid);
796 if (!mustCall && cm_HaveCallback(scp)) return 0;
798 /* turn off mustCall, since it has now forced us past the check above */
801 /* otherwise, we have to make an RPC to get the status */
802 sflags = CM_SCACHESYNC_FETCHSTATUS | CM_SCACHESYNC_GETCALLBACK;
803 cm_SyncOp(scp, NULL, NULL, NULL, 0, sflags);
804 cm_StartCallbackGrantingCall(scp, &cbr);
806 lock_ReleaseMutex(&scp->mx);
808 /* now make the RPC */
809 osi_Log1(afsd_logp, "CALL FetchStatus vp %x", (long) scp);
811 code = cm_Conn(&sfid, userp, reqp, &connp);
814 code = RXAFS_FetchStatus(connp->callp, &tfid,
815 &afsStatus, &callback, &volSync);
817 } while (cm_Analyze(connp, userp, reqp, &sfid, &volSync,
819 code = cm_MapRPCError(code, reqp);
820 osi_Log0(afsd_logp, "CALL FetchStatus DONE");
822 lock_ObtainMutex(&scp->mx);
823 cm_SyncOpDone(scp, NULL, sflags);
825 cm_EndCallbackGrantingCall(scp, &cbr, &callback, 0);
826 cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0);
829 cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0);
831 /* now check to see if we got an error */
832 if (code) return code;
836 /* called periodically by cm_daemon to shut down use of expired callbacks */
837 void cm_CheckCBExpiration(void)
844 lock_ObtainWrite(&cm_scacheLock);
845 for(i=0; i<cm_hashTableSize; i++) {
846 for(scp = cm_hashTablep[i]; scp; scp=scp->nextp) {
848 lock_ReleaseWrite(&cm_scacheLock);
849 lock_ObtainMutex(&scp->mx);
850 if (scp->cbServerp && now > scp->cbExpires) {
851 cm_DiscardSCache(scp);
853 lock_ReleaseMutex(&scp->mx);
854 lock_ObtainWrite(&cm_scacheLock);
855 osi_assert(scp->refCount-- > 0);
858 lock_ReleaseWrite(&cm_scacheLock);
861 /* debug interface: not implemented */
862 int SRXAFSCB_GetCellByNum(struct rx_call *a_call, afs_int32 a_cellnum,
863 char **a_name, serverList *a_hosts)
869 /* debug interface: not implemented */
870 int SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, afs_int32 a_cellnum,
871 char **a_name, serverList *a_hosts)