Coda Distributed File System
potemkin.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2005 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/************************************* fid table entry */
20
21#ifndef _POTEMKIN_H_
22#define _POTEMKIN_H_
23
24#ifndef MAXNAMLEN
25#define MAXNAMLEN 255
26#endif /* MAXNAMLEN */
27
28#ifndef V_BLKSIZE
29#define V_BLKSIZE 8192
30#endif /* V_BLKSIZE */
31
32typedef struct fid_ent_s {
33 struct CodaFid fid;
37 char name[MAXNAMLEN + 1];
39
40#ifdef __NetBSD__
41#ifdef __i386__
42#define SYS_STRING "i386_nbsd1"
43#else
44#define SYS_STRING "nbsd"
45#endif
46#endif
47
48#ifdef __FreeBSD__
49#ifdef __i386__
50#define SYS_STRING "i386_fbsd"
51#else
52#define SYS_STRING "fbsd"
53#endif
54#endif
55
56#ifdef __linux__
57#define SYS_STRING "linux"
58#endif
59
60#ifdef sun
61#define SYS_STRING "solaris"
62#endif
63
64#ifdef LINUX
65#define ATTR_MODE 1
66#define ATTR_UID 2
67#define ATTR_GID 4
68#define ATTR_SIZE 8
69#define ATTR_ATIME 16
70#define ATTR_MTIME 32
71#define ATTR_CTIME 64
72#define ATTR_ATIME_SET 128
73#define ATTR_MTIME_SET 256
74#define ATTR_FORCE 512 /* Not a change, but a change it */
75#define ATTR_ATTR_FLAG 1024
76#define MS_MGC_VAL 0xC0ED0000 /* magic flag number to indicate "new" flags */
77#define umode_t int
78struct iattr {
79 unsigned int ia_valid;
80 umode_t ia_mode;
81 uid_t ia_uid;
82 gid_t ia_gid;
83 off_t ia_size;
84 time_t ia_atime;
85 time_t ia_mtime;
86 time_t ia_ctime;
87 unsigned int ia_attr_flags;
88};
89
90static void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
91
92#define sigcontext sigaction
93#define MOUNT_CFS 0
94#define d_namlen d_reclen
95#define SYS_STRING "linux"
96#define ts_sec tv_sec
97#define ts_nsec tv_nsec
98#else
99#define MOUNT_CFS 1
100#endif
101
102#ifndef CFID_REALM
103#define CFID_REALM 0
104#endif /* CFID_REALM */
105
106#ifndef CFID_VOLUME
107#define CFID_VOLUME 1
108#endif /* CFID_VOLUME */
109
110#ifndef CFID_VNODE
111#define CFID_VNODE 2
112#endif /* CFID_VNODE */
113
114#ifndef CFID_UNIQUE
115#define CFID_UNIQUE 3
116#endif /* CFID_REALM */
117
118/* Taken from venusfid.h and modified -- AW */
119
120inline char *FID_(const struct CodaFid *fid)
121{
122 static char buf[2][37];
123 static int i = 0;
124 i = 1 - i;
125 sprintf(buf[i], "%x.%x.%x.%x", (unsigned int)fid->opaque[CFID_REALM],
126 (unsigned int)fid->opaque[CFID_VOLUME],
127 (unsigned int)fid->opaque[CFID_VNODE],
128 (unsigned int)fid->opaque[CFID_UNIQUE]);
129 return buf[i];
130}
131
132#endif /* _POTEMKIN_H_ */
coda_vtype
Definition: coda.h:219
char * FID_(const struct CodaFid *fid)
Definition: potemkin.h:120
#define CFID_VOLUME
Definition: potemkin.h:107
#define CFID_REALM
Definition: potemkin.h:103
struct fid_ent_s fid_ent_t
#define MAXNAMLEN
Definition: potemkin.h:25
#define CFID_VNODE
Definition: potemkin.h:111
#define CFID_UNIQUE
Definition: potemkin.h:115
Definition: coda.h:201
uint32_t opaque[4]
Definition: coda.h:202
Definition: coda.h:234
Definition: ds_list.private.h:41
Definition: potemkin.h:32
struct CodaFid fid
Definition: potemkin.h:33
enum coda_vtype type
Definition: potemkin.h:34
char name[MAXNAMLEN+1]
Definition: potemkin.h:37
ds_list_t * kids
Definition: potemkin.h:35
struct fid_ent_s * parent
Definition: potemkin.h:36