windows-eventlog-20080308
[openafs.git] / src / WINNT / afsd / cm_callback.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #ifndef _CM_CALLBACK_H_ENV__
11 #define _CM_CALLBACK_H_ENV__ 1
12
13 #include <osi.h>
14
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;
20
21 #include "cm_scache.h"
22
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 */
27     long flags;
28 } cm_racingRevokes_t;
29
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)
35
36 /* flag for calls to functions in this package */
37 #define CM_CALLBACK_MAINTAINCOUNT       1       /* don't decrement count of
38                                                  * callback-granting calls.
39                                                  */
40
41 /* Combinations of change notification filters to make sure callback loss
42  * gets noticed
43  */
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)
52
53 extern void cm_InitCallback(void);
54
55 extern int cm_HaveCallback(struct cm_scache *);
56
57 extern void cm_StartCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *);
58
59 extern void cm_EndCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *,
60         struct AFSCallBack *, long);
61
62 extern long cm_GetCallback(struct cm_scache *, struct cm_user *,
63         struct cm_req * reqp, long flags);
64
65 extern void cm_CheckCBExpiration(void);
66
67 extern osi_rwlock_t cm_callbackLock;
68
69 extern void cm_CallbackNotifyChange(cm_scache_t *scp);
70
71 extern void cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown);
72
73 extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
74
75 extern afs_int32 cm_OfflineROIsValid;
76
77 extern afs_int32 cm_giveUpAllCBs;
78 #endif /*  _CM_CALLBACK_H_ENV__ */