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.
41 /* Combinations of change notification filters to make sure callback loss
44 #define FILE_NOTIFY_GENERIC_DIRECTORY_FILTER \
45 (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME)
46 #define FILE_NOTIFY_GENERIC_FILE_FILTER \
47 (FILE_NOTIFY_CHANGE_ATTRIBUTES \
48 | FILE_NOTIFY_CHANGE_SIZE \
49 | FILE_NOTIFY_CHANGE_LAST_WRITE \
50 | FILE_NOTIFY_CHANGE_LAST_ACCESS \
51 | FILE_NOTIFY_CHANGE_CREATION)
53 extern void cm_InitCallback(void);
55 extern int cm_HaveCallback(struct cm_scache *);
57 extern void cm_StartCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *);
59 extern void cm_EndCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *,
60 struct AFSCallBack *, struct AFSVolSync *, long);
62 extern long cm_GetCallback(struct cm_scache *, struct cm_user *,
63 struct cm_req * reqp, long flags);
65 extern void cm_CheckCBExpiration(void);
67 extern osi_rwlock_t cm_callbackLock;
69 extern void cm_CallbackNotifyChange(cm_scache_t *scp);
71 extern void cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown);
73 extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
75 extern afs_int32 cm_OfflineROIsValid;
77 extern afs_int32 cm_giveUpAllCBs;
79 extern afs_int32 cm_shutdown;
80 #endif /* OPENAFS_WINNT_AFSD_CM_CALLBACK_H */