This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / fs / intermezzo / intermezzo_upcall.h
1 /*
2  * Based on cfs.h from Coda, but revamped for increased simplicity.
3  * Linux modifications by Peter Braam, Aug 1996
4  * Rewritten for InterMezzo
5  */
6
7 #ifndef _PRESTO_HEADER_
8 #define _PRESTO_HEADER_
9
10
11 /* upcall.c */
12 #define SYNCHRONOUS 0
13 #define ASYNCHRONOUS 1
14
15 int lento_permit(int minor, int pathlen, int fsetnamelen, char *path, char *fset);
16 int lento_opendir(int minor, int pathlen, char *path, int async);
17 int lento_kml(int minor, unsigned int offset, unsigned int first_recno,
18               unsigned int length, unsigned int last_recno, int namelen,
19               char *fsetname);
20 int lento_open(int minor, int pathlen, char *path);
21 int lento_journal(int minor, char *page, int async);
22 int lento_release_permit(int minor, int cookie);
23
24 /*
25  * Kernel <--> Lento communications.
26  */
27 /* upcalls */
28 #define LENTO_PERMIT    1
29 #define LENTO_JOURNAL   2
30 #define LENTO_OPENDIR   3
31 #define LENTO_OPEN      4
32 #define LENTO_SIGNAL    5
33 #define LENTO_KML       6
34 #define LENTO_COOKIE    7
35
36 /*         Lento <-> Presto  RPC arguments       */
37 struct lento_up_hdr {
38         unsigned int opcode;
39         unsigned int unique;    /* Keep multiple outstanding msgs distinct */
40         u_short pid;            /* Common to all */
41         u_short uid;
42 };
43
44 /* This structure _must_ sit at the beginning of the buffer */
45 struct lento_down_hdr {
46         unsigned int opcode;
47         unsigned int unique;    
48         unsigned int result;
49 };
50
51 /* lento_permit: */
52 struct lento_permit_in {
53         struct lento_up_hdr uh;
54         int pathlen;
55         int fsetnamelen;
56         char path[0];
57 };
58 struct lento_permit_out {
59         struct lento_down_hdr dh;
60 };
61
62
63 /* lento_opendir: */
64 struct lento_opendir_in {
65         struct lento_up_hdr uh;
66         int async;
67         int pathlen;
68         char path[0];
69 };
70 struct lento_opendir_out {
71         struct lento_down_hdr dh;
72 };
73
74
75 /* lento_kml: */
76 struct lento_kml_in {
77         struct lento_up_hdr uh;
78         unsigned int offset;
79         unsigned int first_recno;
80         unsigned int length;
81         unsigned int last_recno;
82         int namelen;
83         char fsetname[0];
84 };
85
86 struct lento_kml_out {
87         struct lento_down_hdr dh;
88 };
89
90
91 /* lento_open: */
92 struct lento_open_in {
93         struct lento_up_hdr uh;
94         int pathlen;
95         char path[0];
96 };
97 struct lento_open_out {
98     struct lento_down_hdr dh;
99 };
100
101 /* lento_response_cookie */
102 struct lento_response_cookie_in {
103         struct lento_up_hdr uh;
104         int cookie;
105 };
106
107 struct lento_response_cookie_out {
108     struct lento_down_hdr dh;
109 };
110
111
112 struct lento_mknod {
113   struct lento_down_hdr dh;
114   int    major;
115   int    minor;
116   int    mode;
117   char   path[0];
118 };
119
120
121 /* NB: every struct below begins with an up_hdr */
122 union up_args {
123     struct lento_up_hdr uh;             
124     struct lento_permit_in lento_permit;
125     struct lento_open_in lento_open;
126     struct lento_opendir_in lento_opendir;
127     struct lento_kml_in lento_kml;
128     struct lento_response_cookie_in lento_response_cookie;
129 };
130
131 union down_args {
132     struct lento_down_hdr dh;
133     struct lento_permit_out lento_permit;
134     struct lento_open_out lento_open;
135     struct lento_opendir_out lento_opendir;
136     struct lento_kml_out lento_kml;
137     struct lento_response_cookie_out lento_response_cookie;
138 };    
139
140 #include "intermezzo_psdev.h"
141
142 int lento_upcall(int minor, int read_size, int *rep_size, 
143                  union up_args *buffer, int async,
144                  struct upc_req *rq );
145 #endif 
146