Whamcloud - gitweb
A couple days of changes--much improvement.
[fs/lustre-release.git] / lustre / include / linux / presto_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(ino_t ino);
16 int lento_opendir(ino_t ino, int async);
17 int lento_open(ino_t ino);
18 int lento_journal(char *page);
19
20
21
22 /*
23  * Kernel <--> Lento communications.
24  */
25
26 /* downcalls */
27 #define LENTO_PERMIT    1
28 #define LENTO_JOURNAL   2
29 #define LENTO_OPENDIR   3
30 #define LENTO_OPEN      4
31 #define LENTO_SIGNAL    5
32
33 /* upcalls */
34 #define PRESTO_RELEASE_JOURNAL 51
35 #define PRESTO_MARK            52
36
37 #define LENTO_DOWNCALL(opcode) (opcode <= PRESTO_MARK && opcode >= PRESTO_RELEASE_JOURNAL)
38
39 /*         Lento <-> Presto  RPC arguments       */
40 struct lento_up_hdr {
41         unsigned int opcode;
42         unsigned int unique;    /* Keep multiple outstanding msgs distinct */
43         u_short pid;            /* Common to all */
44         u_short uid;
45 };
46
47 /* This structure _must_ sit at the beginning of the buffer */
48 struct lento_down_hdr {
49     unsigned int opcode;
50     unsigned int unique;        
51     unsigned int result;
52 };
53
54 /* lento_permit: */
55 struct lento_permit_in {
56         struct lento_up_hdr uh;
57         ino_t ino;
58 };
59 struct lento_permit_out {
60     struct lento_down_hdr dh;
61 };
62
63
64 /* lento_opendir: */
65 struct lento_opendir_in {
66         struct lento_up_hdr uh;
67         ino_t ino;
68         int   async;
69 };
70 struct lento_opendir_out {
71     struct lento_down_hdr dh;
72 };
73
74
75 /* lento_open: */
76 struct lento_open_in {
77     struct lento_up_hdr uh;
78     ino_t ino;
79 };
80 struct lento_open_out {
81     struct lento_down_hdr dh;
82 };
83
84 /* lento_mark_dentry */
85 struct lento_mark_dentry {  
86         struct lento_down_hdr dh;
87         int    and_flag;
88         int    or_flag;
89         char   path[0];
90 };
91
92 /* NB: every struct below begins with an up_hdr */
93 union up_args {
94     struct lento_up_hdr uh;             
95     struct lento_permit_in lento_permit;
96     struct lento_open_in lento_open;
97     struct lento_opendir_in lento_opendir;
98 };
99
100 union down_args {
101     struct lento_down_hdr dh;
102     struct lento_permit_out lento_permit;
103     struct lento_open_out lento_open;
104     struct lento_opendir_out lento_opendir;
105 };    
106
107 union lento_downcalls {
108         struct lento_down_hdr        dch;
109         struct lento_mark_dentry     mark;
110 };
111
112 int lento_upcall(int read_size, int *rep_size, 
113                  union up_args *buffer, int async);
114 #endif 
115