Coda Distributed File System
coppend.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19/*
20 *
21 * Specification of the Cop Pending table entries
22 *
23 */
24
25#ifndef _VICE_COPPEND_H_
26#define _VICE_COPPEND_H_ 1
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include <stdio.h>
33#include <lwp/lock.h>
34#include <vice.h>
35#include <rpc2/rpc2.h>
36
37#ifdef __cplusplus
38}
39#endif
40
41#include <ohash.h>
42
43#define MAXFIDS 4 /* The most fids used by any operation. */
44#define CPENTMAGIC 0x202842
45/* cop pending entry */
46class cpent : public olink {
47 friend void AddPairToCopPendingTable(ViceStoreId *, ViceFid *);
48 friend long InternalCOP2(RPC2_Handle, ViceStoreId *, ViceVersionVector *);
49 friend class cpman;
50
51 ViceStoreId StoreId;
52 ViceFid fids[MAXFIDS]; /* fids of all objects mutated in operation */
53 long time; /* expiration time for entry */
54 int deqing;
55 int id;
56
57public:
58 cpent(ViceStoreId *, ViceFid *);
59 ~cpent();
60 void print();
61 void print(FILE *);
62 void print(int);
63};
64
65#define COPHASHSIZE 128 /* size of objects hash table */
66
67/* daemon to maintain entries for pending cop's */
68class cpman {
69 char *name;
70 struct Lock lock;
71 PROCESS pid;
72 ohashtab objects;
73
74 cpman(const char * = "anonymous coppendbuster");
75 ~cpman();
76
77 friend void cpman_func(void *);
78 void func(int);
79
80 friend void InitCopPendingTable();
81 friend class cpent;
82 friend void AddPairToCopPendingTable(ViceStoreId *, ViceFid *);
83 cpent *find(ViceStoreId *);
84
85public:
86 void add(cpent *);
87 void remove(cpent *);
88 // cpent *find(ViceFid *);
89 cpent *findanddeq(ViceStoreId *);
90 void print();
91 void print(FILE *);
92 void print(int);
93};
94
95extern cpman *CopPendingMan;
96extern void InitCopPendingTable();
97extern void AddToCopPendingTable(ViceStoreId *, ViceFid *);
98extern void AddPairToCopPendingTable(ViceStoreId *, ViceFid *);
99
100#endif /* _VICE_COPPEND_H_ */
Definition: coppend.h:46
void print()
Definition: coppend.cc:100
cpent(ViceStoreId *, ViceFid *)
Definition: coppend.cc:81
~cpent()
Definition: coppend.cc:90
friend long InternalCOP2(RPC2_Handle, ViceStoreId *, ViceVersionVector *)
Definition: codaproc.cc:2146
friend void AddPairToCopPendingTable(ViceStoreId *, ViceFid *)
Definition: coppend.cc:55
Definition: coppend.h:68
cpent * findanddeq(ViceStoreId *)
Definition: coppend.cc:240
void add(cpent *)
Definition: coppend.cc:183
void print()
Definition: coppend.cc:265
friend void InitCopPendingTable()
Definition: coppend.cc:45
void remove(cpent *)
Definition: coppend.cc:198
friend void AddPairToCopPendingTable(ViceStoreId *, ViceFid *)
Definition: coppend.cc:55
friend void cpman_func(void *)
Definition: coppend.cc:127
Definition: ohash.h:45
cpman * CopPendingMan
Definition: coppend.cc:43
void AddToCopPendingTable(ViceStoreId *, ViceFid *)
Definition: coppend.cc:50
void InitCopPendingTable()
Definition: coppend.cc:45
#define MAXFIDS
Definition: coppend.h:43
void AddPairToCopPendingTable(ViceStoreId *, ViceFid *)
Definition: coppend.cc:55
ENTRY * find()
RPC2_Integer RPC2_Handle
Definition: rpc2.h:345
Definition: lock.h:68
Definition: lwp.private_pt.h:33