Coda Distributed File System
dirbody.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
16#*/
17
18/*
19 IBM COPYRIGHT NOTICE
20
21 Copyright (C) 1986
22 International Business Machines Corporation
23 All Rights Reserved
24
25This file contains some code identical to or derived from the 1986
26version of the Andrew File System ("AFS"), which is owned by the IBM
27Corporation. This code is provided "AS IS" and IBM does not warrant
28that it is free of infringement of any intellectual rights of any
29third party. IBM disclaims liability of any kind for any damages
30whatsoever resulting directly or indirectly from use of this software
31or of any derivative work. Carnegie Mellon University has obtained
32permission to modify, distribute and sublicense this code, which is
33based on Version 2 of AFS and does not contain the features and
34enhancements that are part of Version 3 of AFS. Version 3 of AFS is
35commercially available and supported by Transarc Corporation,
36Pittsburgh, PA.
37
38*/
39
40#ifndef _DIR_BODY_H_
41#define _DIR_BODY_H_ 1
42
43#ifndef O_BINARY
44#define O_BINARY 0
45#endif
46
47#define LOGPS 11 /* log page size */
48#define NHASH 128 /* entries in the hash tbl */
49#define EPP 64 /* dir entries per page */
50#define LEPP 6 /* log above */
51#define ESZ 32 /* entry size (PAGESIZE / EPP) */
52#define LESZ 5 /* log above */
53#define DHE 12 /* entries in a dir header above a page header */
54
55#define FFIRST (char)1
56
57/* A directory blob. */
58struct DirBlob {
59 char name[32];
60};
61
62/* A page header entry: padded to be a 32 byte blob. */
63struct PageHeader {
64 int tag;
65 char freecount; /* duplicated info: also in allomap */
66 char freebitmap[EPP / 8];
67 char padding[32 - (5 + EPP / 8)];
68};
69
70/* A directory header object. */
71struct DirHeader {
73 char dirh_allomap[DIR_MAXPAGES]; /* one byte per 2K page */
75};
76
77int DIR_rvm(void);
79extern void DIR_Free(struct DirHeader *, int);
80extern int DirHash(char *);
81extern int DirToNetBuf(long *, char *, int, int *);
82void DIR_CpyVol(struct ViceFid *target, struct ViceFid *source);
83int DIR_MakeDir(struct DirHeader **dir, struct DirFid *me,
84 struct DirFid *parent);
85int DIR_LookupByFid(PDirHeader dhp, char *name, struct DirFid *fid);
86int DIR_Lookup(struct DirHeader *dir, const char *entry, struct DirFid *fid,
87 int flags);
88int DIR_EnumerateDir(struct DirHeader *dhp,
89 int (*hookproc)(struct DirEntry *de, void *hook),
90 void *hook);
91int DIR_Create(struct DirHeader **dh, const char *entry, struct DirFid *fid);
92int DIR_Length(struct DirHeader *dir);
93int DIR_Delete(struct DirHeader *dir, const char *entry);
94void DIR_PrintChain(PDirHeader dir, int chain, FILE *f);
95int DIR_Hash(const char *string);
96int DIR_DirOK(PDirHeader pdh);
97int DIR_Convert(PDirHeader dir, char *file, VolumeId vol, RealmId realm);
98void DIR_Setpages(PDirHeader, int);
99
100#endif /* _DIR_PRIVATE_H_ */
#define DIR_MAXPAGES
Definition: codadir.h:33
#define EPP
Definition: dirbody.h:49
void DIR_PrintChain(PDirHeader dir, int chain, FILE *f)
Definition: dirbody.c:671
int DIR_rvm(void)
Definition: dirbody.c:114
int DIR_Convert(PDirHeader dir, char *file, VolumeId vol, RealmId realm)
Definition: dirbody.c:786
void DIR_CpyVol(struct ViceFid *target, struct ViceFid *source)
int DIR_DirOK(PDirHeader pdh)
Definition: dirbody.c:1108
int DIR_Delete(struct DirHeader *dir, const char *entry)
Definition: dirbody.c:546
int DIR_IsEmpty(PDirHeader)
void DIR_Free(struct DirHeader *, int)
Definition: dirbody.c:647
int DIR_MakeDir(struct DirHeader **dir, struct DirFid *me, struct DirFid *parent)
Definition: dirbody.c:588
int DIR_Hash(const char *string)
Definition: dirbody.c:987
int DIR_Length(struct DirHeader *dir)
Definition: dirbody.c:461
void DIR_Setpages(PDirHeader, int)
Definition: dirbody.c:637
int DIR_LookupByFid(PDirHeader dhp, char *name, struct DirFid *fid)
Definition: dirbody.c:426
int DirHash(char *)
int DirToNetBuf(long *, char *, int, int *)
int DIR_EnumerateDir(struct DirHeader *dhp, int(*hookproc)(struct DirEntry *de, void *hook), void *hook)
Definition: dirbody.c:886
#define NHASH
Definition: dirbody.h:48
int DIR_Create(struct DirHeader **dh, const char *entry, struct DirFid *fid)
Definition: dirbody.c:485
int DIR_Lookup(struct DirHeader *dir, const char *entry, struct DirFid *fid, int flags)
Definition: dirbody.c:754
FILE * file
Definition: dirtest.c:723
name
Definition: pwdtopdbtool.py:40
struct @31::@33 dir
@ f
Definition: rvm_private.h:416
PROCESS parent
Definition: smon2.c:80
Definition: dirbody.h:58
char name[32]
Definition: dirbody.h:59
Definition: codadir.h:66
Definition: dirbody.h:71
struct PageHeader dirh_ph
Definition: dirbody.h:72
short dirh_hashTable[NHASH]
Definition: dirbody.h:74
char dirh_allomap[DIR_MAXPAGES]
Definition: dirbody.h:73
Definition: dirbody.h:63
char padding[32 -(5+EPP/8)]
Definition: dirbody.h:67
int tag
Definition: dirbody.h:64
char freecount
Definition: dirbody.h:65
char freebitmap[EPP/8]
Definition: dirbody.h:66
Definition: codamergedump.cc:54