1116930494ae695447193d49ee6b9e8f2c7fbed6
[openafs.git] / src / WINNT / afsd / cm_aclent.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_ACLENT_H_
11 #define _CM_ACLENT_H_   1
12
13 #include <osi.h>
14
15 #define cm_TGTLifeTime(x)       (0x7fffffff)
16
17 #define CM_ACLENT_MAGIC    ('A' | 'C' <<8 | 'L'<<16 | 'E'<<24)
18
19 /*
20  * Structure to hold an acl entry for a cached file
21  */
22 typedef struct cm_aclent {
23     osi_queue_t q;              /* for quick removal from LRUQ */
24     afs_uint32 magic;           
25     struct cm_aclent *nextp;    /* next guy same vnode */
26     struct cm_scache *backp;    /* back ptr to vnode */
27     struct cm_user *userp;      /* user whose access is cached */
28     afs_uint32 randomAccess;    /* watch for more rights in acl.h */
29     afs_uint32 tgtLifetime;     /* time this expires */
30 } cm_aclent_t;
31
32 extern osi_rwlock_t cm_aclLock;
33
34 extern long cm_InitACLCache(int newFile, long size);
35
36 extern long cm_FindACLCache(struct cm_scache *scp, struct cm_user *userp, afs_uint32 *rightsp);
37
38 static cm_aclent_t *GetFreeACLEnt(cm_scache_t * scp);
39
40 extern long cm_AddACLCache(struct cm_scache *scp, struct cm_user *userp, afs_uint32 rights);
41
42 extern void cm_FreeAllACLEnts(struct cm_scache *scp);
43
44 extern void cm_InvalidateACLUser(struct cm_scache *scp, struct cm_user *userp);
45
46 extern long cm_ValidateACLCache(void);
47
48 extern long cm_ShutdownACLCache(void);
49
50 #endif  /* _CM_ACLENT_H_ */