Coda Distributed File System
resolve.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 1987-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 _RESOLVE_H_
20#define _RESOLVE_H_
21
22/*
23 * resolve.h
24 * Created 09/18/89 Puneet Kumar
25 */
26
27/* Header file for definitions used by the
28 * resolution subsystem
29 */
30#include <vcrcommon.h>
31
32#ifdef MAXNAMELEN
33#undef MAXNAMELEN
34#endif
35#define MAXNAMELEN 255
36#define AVGDIRENTRYSIZE 12
37#define GROWSIZE 32
38#define MAXHOSTS 8
39#define ISDIRVNODE(vnode) ((vnode) & 1) /* directory vnodes are odd */
40#define NNCONFLICTS -1
41
42struct Acl {
43 int nplus;
44 int nminus;
47};
48
49struct AclEntry {
51 long rights;
52};
53
54struct repinfo {
55 char *user, *rights; /* ACL sets (what to set ACL's to if conflicting) */
56 char *owner; /* Owner sets (what to set owner to...) */
57 char *mode; /* Mode sets */
58 char *fixed; /* Location of 'fixed' file/directory if non-interactive */
59 char interactive; /* flag indicating whether repair is interactive */
60};
61
62/* definition of directory entries within a directory conflict replica
63 * as used by the resolution subsystem */
64typedef struct {
65 char name[MAXNAMELEN + 1]; /* name of the entry */
66 /* char realm // not needed because cross-realm mtpts aren't supported
67 * (Jan has a good comment on authentication issues somewhere) */
68 ViceFid fid;
69 ViceVersionVector VV;
70 int MtPt; /* Is this child a mount point? */
72 int index; /* Functions as a index for resreplica arrays */
74
75/* definition of the parent directory replica */
76typedef struct {
77 int entry1; /* index of first child in table */
78 int nentries; /* number of children */
79 ViceFid fid;
80 char *path; /* path name of the RO mounted copy */
81 u_short modebits;
82 struct Acl *al;
83 short owner;
85
86/* globals */
88extern int direntriesarrsize;
89extern int nextavailindex;
90extern resdir_entry *
91 *sortedArrByFidName; /* for sorting the direntries in fid order*/
92extern resdir_entry *
93 *sortedArrByName; /* for sorting the direntries in name order */
94extern int totaldirentries;
95extern int nConflicts;
96
97extern void InitListHdr(int, resreplica *, struct listhdr **);
98extern int InsertListHdr(int, struct repair *, struct listhdr **, int);
99extern int InRepairList(struct listhdr *, unsigned, VnodeId, Unique_t);
100extern int IsCreatedEarlier(struct listhdr **, int, VnodeId, Unique_t);
101extern int getunixdirreps(int, char **, resreplica **);
102extern int dirresolve(int, resreplica *, int (*)(char *), struct listhdr **,
103 VolumeId, struct repinfo *, char *realm);
104extern void resClean(int, resreplica *, struct listhdr *);
105extern int GetParent(char *realm, ViceFid *, ViceFid *, char *, char *);
106
107#endif
name
Definition: pwdtopdbtool.py:40
int IsCreatedEarlier(struct listhdr **, int, VnodeId, Unique_t)
Definition: resolve.cc:402
void resClean(int, resreplica *, struct listhdr *)
Definition: resolve.cc:701
resdir_entry * direntriesarr
Definition: resolve.cc:67
int nConflicts
Definition: resolve.cc:75
int getunixdirreps(int, char **, resreplica **)
#define MAXNAMELEN
Definition: resolve.h:35
int dirresolve(int, resreplica *, int(*)(char *), struct listhdr **, VolumeId, struct repinfo *, char *realm)
Definition: resolve.cc:600
void InitListHdr(int, resreplica *, struct listhdr **)
Definition: resolve.cc:350
int nextavailindex
Definition: resolve.cc:69
int InRepairList(struct listhdr *, unsigned, VnodeId, Unique_t)
Definition: resolve.cc:389
int totaldirentries
Definition: resolve.cc:72
int direntriesarrsize
Definition: resolve.cc:68
int InsertListHdr(int, struct repair *, struct listhdr **, int)
Definition: resolve.cc:362
int GetParent(char *realm, ViceFid *, ViceFid *, char *, char *)
Definition: resolve.cc:726
resdir_entry ** sortedArrByName
Definition: resolve.cc:71
resdir_entry ** sortedArrByFidName
Definition: resolve.cc:70
Definition: resolve.h:49
long rights
Definition: resolve.h:51
char name[MAXNAMELEN]
Definition: resolve.h:50
Definition: resolve.h:42
int nminus
Definition: resolve.h:44
struct AclEntry * pluslist
Definition: resolve.h:45
int nplus
Definition: resolve.h:43
struct AclEntry * minuslist
Definition: resolve.h:46
Definition: repio.h:108
Definition: repio.h:48
Definition: resolve.h:54
char * user
Definition: resolve.h:55
char * fixed
Definition: resolve.h:58
char * owner
Definition: resolve.h:56
char * mode
Definition: resolve.h:57
char interactive
Definition: resolve.h:59
char * rights
Definition: resolve.h:55
Definition: resolve.h:64
int lookedAt
Definition: resolve.h:71
ViceFid fid
Definition: resolve.h:68
int index
Definition: resolve.h:72
int MtPt
Definition: resolve.h:70
ViceVersionVector VV
Definition: resolve.h:69
Definition: resolve.h:76
ViceFid fid
Definition: resolve.h:79
int entry1
Definition: resolve.h:77
int nentries
Definition: resolve.h:78
char * path
Definition: resolve.h:80
struct Acl * al
Definition: resolve.h:82
short owner
Definition: resolve.h:83
u_short modebits
Definition: resolve.h:81