rx: Remove RX_CALL_BUSY
[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 OPENAFS_WINNT_AFSD_CM_CALLBACK_H
11 #define OPENAFS_WINNT_AFSD_CM_CALLBACK_H 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 #define CM_CALLBACK_BULKSTAT            2       /* volSync may not be trustworthy */
41
42 /* Combinations of change notification filters to make sure callback loss
43  * gets noticed
44  */
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)
53
54 extern void cm_InitCallback(void);
55
56 extern int cm_HaveCallback(struct cm_scache *);
57
58 extern void cm_StartCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *);
59
60 extern int cm_EndCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *,
61         struct AFSCallBack *, struct AFSVolSync *, long);
62
63 extern long cm_GetCallback(struct cm_scache *, struct cm_user *,
64         struct cm_req * reqp, long flags);
65
66 extern void cm_CheckCBExpiration(void);
67
68 extern osi_rwlock_t cm_callbackLock;
69
70 extern void cm_CallbackNotifyChange(cm_scache_t *scp);
71
72 extern void cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown);
73
74 extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
75
76 extern void cm_GiveUpAllCallbacksAllServersMulti(afs_int32 markDown);
77
78 extern afs_int32 cm_OfflineROIsValid;
79
80 extern afs_int32 cm_giveUpAllCBs;
81
82 extern afs_int32 cm_shutdown;
83
84 #endif /*  OPENAFS_WINNT_AFSD_CM_CALLBACK_H */