Protect ubik cache accesses
[openafs.git] / src / budb / budb_internal.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 _BUDB_PROTOTYPES_H
11 #define _BUDB_PROTOTYPES_H
12
13 /* db_alloc.c */
14 afs_int32 InitDBalloc(void);
15 afs_int32 AllocStructure(struct ubik_trans *ut, char type, dbadr related,
16                          dbadr *saP, void *s);
17 afs_int32 FreeStructure(struct ubik_trans *ut, char type, dbadr sa);
18 afs_int32 AllocBlock(struct ubik_trans *, struct block *, dbadr *);
19 afs_int32 FreeBlock(struct ubik_trans *, struct blockHeader *, dbadr);
20
21 /* db_dump.c */
22 afs_int32 writeDatabase(struct ubik_trans *, int);
23
24 /* db_hash.c */
25
26 afs_int32 InitDBhash(void);
27 void ht_DBInit(void);
28 afs_int32 ht_HashOut(struct ubik_trans *ut, struct memoryHashTable *mht,
29                      dbadr ea, void *e);
30 afs_int32 RemoveFromList(struct ubik_trans *ut, dbadr ea, void *e,
31                          dbadr *head, dbadr ta, void *t, dbadr *thread);
32 afs_int32 ht_LookupEntry(struct ubik_trans *ut, struct memoryHashTable *mht,
33                           void *key, dbadr *eaP, void *e);
34 afs_int32 ht_HashIn(struct ubik_trans *ut, struct memoryHashTable *mht,
35                     dbadr ea, void *e);
36 afs_int32 scanHashTable(struct ubik_trans *ut, struct memoryHashTable *mhtPtr,
37                         int (*selectFn) (dbadr, void *, void *),
38                         int (*operationFn) (dbadr, void *, void *),
39                         void *rockPtr);
40
41 /* db_lock.c */
42 int checkLockHandle(struct ubik_trans *, afs_uint32);
43
44 /* dbs_dump.c */
45 afs_int32 badEntry(afs_uint32 dbAddr);
46
47 /* ol_verify.c */
48 afs_int32 checkDiskAddress(unsigned long, int, int *, int *);
49
50 /* procs.c */
51 afs_int32 InitProcs(void);
52 int callPermitted(struct rx_call *);
53 afs_int32 InitRPC(struct ubik_trans **, int lock, int this_op);
54
55 /* server.c */
56
57 void Log(char *fmt, ... );
58 void LogError(long code, char *fmt, ... );
59 void LogDebug(int level, char *fmt, ... );
60
61 /* struct_ops.c */
62
63 void tape_ntoh(struct tape *, struct tape *);
64 void principal_hton(struct budb_principal *, struct budb_principal *);
65 void principal_ntoh(struct budb_principal *, struct budb_principal *);
66 void structDumpHeader_hton(struct structDumpHeader *,
67                            struct structDumpHeader *);
68 int tapeSet_ntoh(struct budb_tapeSet *, struct budb_tapeSet *);
69 int tapeSet_hton(struct budb_tapeSet *, struct budb_tapeSet *);
70 void volInfo_ntoh(struct volInfo *, struct volInfo *);
71 void volFragment_ntoh(struct volFragment *, struct volFragment *);
72 void dump_ntoh(struct dump *, struct dump *);
73 int dumpToBudbDump(dbDumpP, struct budb_dumpEntry *);
74 int tapeToBudbTape(struct tape *r, struct budb_tapeEntry *);
75 int volsToBudbVol(struct volFragment *, struct volInfo *,
76                   struct budb_volumeEntry *);
77 void printDump(FILE *, struct dump *);
78 int printPrincipal(struct budb_principal *ptr);
79 int printTape(FILE *, struct tape *);
80 int printTapeSet(struct budb_tapeSet *, afs_int32);
81 int printVolInfo(FILE *, struct volInfo *);
82 int printVolFragment(FILE *, struct volFragment *);
83 int printMemoryHashTable(FILE *, struct memoryHashTable *);
84
85 /* database.c */
86 afs_int32 CheckInit(struct ubik_trans *, int (*db_init) (struct ubik_trans *));
87 afs_int32 InitDB(void);
88
89 #endif