Coda Distributed File System
realmdb.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 2003-2025 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#ifndef _REALMDB_H_
20#define _REALMDB_H_
21
22#include <rvmlib.h>
23#include "realm.h"
24
25/* special realm used for local 'fake' volumes */
26#define LOCALREALM "localhost"
27extern Realm *LocalRealm;
28
29/* persistent reference to the RealmDB object */
30#define REALMDB (rvg->recov_REALMDB)
31
32class RealmDB {
33 friend void RealmDBInit(void);
34 friend class fsobj; // Fakeify
35
36public:
37 void *operator new(size_t size) REQUIRES_TRANSACTION
38 {
39 void *p = rvmlib_rec_malloc(size);
40 CODA_ASSERT(p);
41 return p;
42 }
43
44 void operator delete(void *p) REQUIRES_TRANSACTION { rvmlib_rec_free(p); }
45
47 ~RealmDB(void);
48
50
51 Realm *GetRealm(const char *realm) EXCLUDES_TRANSACTION;
52 Realm *GetRealm(const RealmId realmid);
53
55
56 void print(FILE *f);
57 void print(void) { print(stdout); }
58
59private:
60 struct dllist_head realms;
61 RealmId max_realmid; /*T*/
62};
63
65
66#endif /* _REALMDB_H_ */
Definition: realmdb.h:32
RealmDB(void) REQUIRES_TRANSACTION
Definition: realmdb.cc:26
friend void RealmDBInit(void)
Definition: realmdb.cc:145
void print(void)
Definition: realmdb.h:57
~RealmDB(void)
Definition: realmdb.cc:33
void GetDown(void) EXCLUDES_TRANSACTION
Definition: realmdb.cc:106
void ResetTransient(void) EXCLUDES_TRANSACTION
Definition: realmdb.cc:39
Realm * GetRealm(const char *realm) EXCLUDES_TRANSACTION
Definition: realmdb.cc:62
Definition: realm.h:31
Definition: fso.h:343
#define CODA_ASSERT(pred)
Definition: coda_assert.h:22
#define REQUIRES_TRANSACTION
Definition: coda_tsa.h:107
#define EXCLUDES_TRANSACTION
Definition: coda_tsa.h:108
stdout
Definition: volusage.py:12
void RealmDBInit(void) EXCLUDES_TRANSACTION
Definition: realmdb.cc:145
Realm * LocalRealm
Definition: realmdb.cc:24
@ f
Definition: rvm_private.h:416
#define rvmlib_rec_free(addr)
Definition: rvmlib.h:123
#define rvmlib_rec_malloc(size)
Definition: rvmlib.h:122
Definition: dllist.h:30