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 #ifndef OPENAFS_WINNT_AFSD_CM_CALLBACK_H
11 #define OPENAFS_WINNT_AFSD_CM_CALLBACK_H 1
15 typedef struct cm_callbackRequest {
16 long callbackCount; /* callback count at start of the request */
17 time_t startTime; /* time when we started the call */
18 struct cm_server *serverp; /* server we really got the callback from */
19 } cm_callbackRequest_t;
21 #include "cm_scache.h"
23 typedef struct cm_racingRevokes {
24 osi_queue_t q; /* queue for forward/backward searches */
25 cm_fid_t fid; /* fid revoked */
26 long callbackCount; /* which callback this is */
30 /* flags for cm_racingRevokes_t flags field */
31 #define CM_RACINGFLAG_CANCELALL 1 /* cancels all racing callback grants */
32 #define CM_RACINGFLAG_CANCELVOL 2 /* cancels all this volume */
33 /* and one representing the union of all cancel descrs */
34 #define CM_RACINGFLAG_ALL (CM_RACINGFLAG_CANCELALL | CM_RACINGFLAG_CANCELVOL)
36 /* flag for calls to functions in this package */
37 #define CM_CALLBACK_MAINTAINCOUNT 1 /* don't decrement count of
38 * callback-granting calls.
40 #define CM_CALLBACK_BULKSTAT 2 /* volSync may not be trustworthy */
42 /* Combinations of change notification filters to make sure callback loss
45 #define FILE_NOTIFY_GENERIC_DIRECTORY_FILTER \
46 (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME)
47 #define FILE_NOTIFY_GENERIC_FILE_FILTER \
48 (FILE_NOTIFY_CHANGE_ATTRIBUTES \
49 | FILE_NOTIFY_CHANGE_SIZE \
50 | FILE_NOTIFY_CHANGE_LAST_WRITE \
51 | FILE_NOTIFY_CHANGE_LAST_ACCESS \
52 | FILE_NOTIFY_CHANGE_CREATION)
54 extern void cm_InitCallback(void);
56 extern int cm_HaveCallback(struct cm_scache *);
58 extern void cm_StartCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *);
60 extern int cm_EndCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *,
61 struct AFSCallBack *, struct AFSVolSync *, long);
63 extern long cm_GetCallback(struct cm_scache *, struct cm_user *,
64 struct cm_req * reqp, long flags);
66 extern void cm_CheckCBExpiration(void);
68 extern osi_rwlock_t cm_callbackLock;
70 extern void cm_CallbackNotifyChange(cm_scache_t *scp);
72 extern void cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown);
74 extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
76 extern void cm_GiveUpAllCallbacksAllServersMulti(afs_int32 markDown);
78 extern afs_int32 cm_OfflineROIsValid;
80 extern afs_int32 cm_giveUpAllCBs;
82 extern afs_int32 cm_shutdown;
84 #endif /* OPENAFS_WINNT_AFSD_CM_CALLBACK_H */