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
14 * The way to use this package is:
15 * If the cache pointer is not NULL, call afs_findAxs, and if it's not
16 * NULL, use its access field
18 * axs_Alloc a new one,
20 * insert it at the head of the list.
22 * Of course, don't forget to axs_Free them occasionally,
24 * Alloc and Free need a lock on the freelist, the other guys are safe if the
25 * parent structure is locked, but probably REQUIRE the parent to be locked...
29 afs_int32 uid; /* most frequently used field, I think */
31 struct axscache * next;
34 extern struct axscache *axs_Alloc(), *afs_SlowFindAxs();
35 extern void afs_RemoveAxs(), afs_FreeAllAxs();
36 extern afs_rwlock_t afs_xaxs;
38 /* DON'T use this with a NULL pointer!
39 * the quick check should cover 99.9% of the cases
41 #define afs_FindAxs(cachep,id) (((cachep)->uid == id) ? cachep : afs_SlowFindAxs(&(cachep),id))
43 #define axs_Front(head,pp,p) {(pp)->next = (p)->next; (p)->next= *(head);*(head)=(p);}
45 #define afs_AddAxs(cachep,id,bits) { \
46 struct axscache *ac; \
47 if (ac = axs_Alloc()) { \
49 ac->axess = (afs_int32)bits; \