]> andersk Git - moira.git/blob - afssync/ubik.c
Synchronization speedup by optimizing out WhoIsThis*
[moira.git] / afssync / ubik.c
1 /* $Header$ */
2
3 #include <sys/types.h>
4 #include <lock.h>
5 #define UBIK_INTERNALS
6 #include <ubik.h>
7 #include <rx/xdr.h>
8 #include "print.h"
9 #include "prserver.h"
10
11
12 struct ubik_dbase *dbase;
13
14 int ubik_ServerInit()
15 {
16     return(0);
17 }
18
19 int ubik_BeginTrans()
20 {
21     return(0);
22 }
23
24 int ubik_BeginTransReadAny()
25 {
26     return(0);
27 }
28
29 int ubik_AbortTrans()
30 {
31     return(0);
32 }
33
34 int ubik_EndTrans()
35 {
36     return(0);
37 }
38
39 int ubik_Tell()
40 {
41     return(0);
42 }
43
44 int ubik_Truncate()
45 {
46     return(0);
47 }
48
49 long ubik_SetLock()
50 {
51     return(0);
52 }
53
54 int ubik_WaitVersion()
55 {
56     return(0);
57 }
58
59 int ubik_CacheUpdate()
60 {
61     return(0);
62 }
63
64 int panic(a, b, c, d)
65 char *a, *b, *c, *d;
66 {
67     printf(a, b, c, d);
68     abort();
69     printf("BACK FROM ABORT\n");    /* shouldn't come back from floating pt exception */
70     exit(1);    /* never know, though */
71 }
72
73 int ubik_GetVersion(dummy, ver)
74 int dummy;
75 struct ubik_version *ver;
76 {
77     bzero(ver, sizeof(struct ubik_version));
78     return(0);
79 }
80
81
82 extern int dbase_fd;
83
84 int ubik_Seek(tt, afd, pos)
85 struct ubik_trans *tt;
86 long afd;
87 long pos;
88 {
89     if (lseek(dbase_fd, pos+HDRSIZE, 0) < 0) {
90         perror("ubik_Seek");
91         return(-1);
92     }
93     return(0);
94 }
95
96 int ubik_Write(tt, buf, len)
97 struct ubik_trans *tt;
98 char *buf;
99 long len;
100 {
101     int status;
102
103     status = write(dbase_fd, buf, len);
104     if (status < len) {
105         perror("ubik_Write");
106         return(1);
107     }
108     return(0);
109 }
110
111 int ubik_Read(tt, buf, len)
112 struct ubik_trans *tt;
113 char *buf;
114 long len;
115 {
116     int status;
117     
118     status = read(dbase_fd, buf, len);
119     if (status < 0) {
120         perror("ubik_Read");
121         return(1);
122     }
123     if (status < len)
124       bzero(&buf[status], len - status);
125     return(0);
126 }
127
128
129 /* Global declarations from ubik.c */
130 long ubik_quorum=0;
131 struct ubik_dbase *ubik_dbase=0;
132 struct ubik_stats ubik_stats;
133 long ubik_host;
134 long ubik_epochTime = 0;
135 long urecovery_state = 0;
136
137 struct rx_securityClass *ubik_sc[3];
138
139
140 /* Other declarations */
141
142 afsconf_GetNoAuthFlag()
143 {
144     return(1);
145 }
146
147
148 char *prdir = "/dev/null";
149 struct prheader cheader;
150 int pr_realmNameLen;
151 char *pr_realmName;
This page took 0.064352 seconds and 5 git commands to generate.