OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/afsd/cm_callback.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #ifndef OPENAFS_WINNT_AFSD_CM_CALLBACK_H
00011 #define OPENAFS_WINNT_AFSD_CM_CALLBACK_H 1
00012 
00013 #include <osi.h>
00014 
00015 typedef struct cm_callbackRequest {
00016     long callbackCount;         /* callback count at start of the request */
00017     time_t startTime;   /* time when we started the call */
00018     struct cm_server *serverp;  /* server we really got the callback from */
00019 } cm_callbackRequest_t;
00020 
00021 #include "cm_scache.h"
00022 
00023 typedef struct cm_racingRevokes {
00024     osi_queue_t q;              /* queue for forward/backward searches */
00025     cm_fid_t fid;               /* fid revoked */
00026     long callbackCount;         /* which callback this is */
00027     long flags;
00028 } cm_racingRevokes_t;
00029 
00030 /* flags for cm_racingRevokes_t flags field */
00031 #define CM_RACINGFLAG_CANCELALL         1       /* cancels all racing callback grants */
00032 #define CM_RACINGFLAG_CANCELVOL         2       /* cancels all this volume */
00033 /* and one representing the union of all cancel descrs */
00034 #define CM_RACINGFLAG_ALL               (CM_RACINGFLAG_CANCELALL | CM_RACINGFLAG_CANCELVOL)
00035 
00036 /* flag for calls to functions in this package */
00037 #define CM_CALLBACK_MAINTAINCOUNT       1       /* don't decrement count of
00038                                                  * callback-granting calls.
00039                                                  */
00040 #define CM_CALLBACK_BULKSTAT            2       /* volSync may not be trustworthy */
00041 
00042 /* Combinations of change notification filters to make sure callback loss
00043  * gets noticed
00044  */
00045 #define FILE_NOTIFY_GENERIC_DIRECTORY_FILTER \
00046         (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME)
00047 #define FILE_NOTIFY_GENERIC_FILE_FILTER \
00048         (FILE_NOTIFY_CHANGE_ATTRIBUTES \
00049          | FILE_NOTIFY_CHANGE_SIZE \
00050          | FILE_NOTIFY_CHANGE_LAST_WRITE \
00051          | FILE_NOTIFY_CHANGE_LAST_ACCESS \
00052          | FILE_NOTIFY_CHANGE_CREATION)
00053 
00054 extern void cm_InitCallback(void);
00055 
00056 extern int cm_HaveCallback(struct cm_scache *);
00057 
00058 extern void cm_StartCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *);
00059 
00060 extern int cm_EndCallbackGrantingCall(struct cm_scache *, cm_callbackRequest_t *,
00061         struct AFSCallBack *, struct AFSVolSync *, long);
00062 
00063 extern long cm_GetCallback(struct cm_scache *, struct cm_user *,
00064         struct cm_req * reqp, long flags);
00065 
00066 extern void cm_CheckCBExpiration(void);
00067 
00068 extern osi_rwlock_t cm_callbackLock;
00069 
00070 extern void cm_CallbackNotifyChange(cm_scache_t *scp);
00071 
00072 extern void cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown);
00073 
00074 extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
00075 
00076 extern void cm_GiveUpAllCallbacksAllServersMulti(afs_int32 markDown);
00077 
00078 extern afs_int32 cm_OfflineROIsValid;
00079 
00080 extern afs_int32 cm_giveUpAllCBs;
00081 
00082 extern afs_int32 cm_shutdown;
00083 
00084 #endif /*  OPENAFS_WINNT_AFSD_CM_CALLBACK_H */
 All Data Structures Files Functions Variables