Whamcloud - gitweb
- Added some fields for rpc double buffering
[fs/lustre-release.git] / lustre / include / linux / obd_rpc.h
1 #ifndef __OBD_RPC_H
2 #define __OBD_RPC_H
3 /*
4  * Copyright (C) 2001  Cluster File Systems, Inc.
5  *
6  * This code is issued under the GNU General Public License.
7  * See the file COPYING in this distribution
8  */
9
10 #include <linux/sunrpc/svc.h>
11 #define OBD_TGT_VERSION  001
12
13 #define OBD_TGT_TCP  0x1
14 #define OBD_TGT_INTR 0x2
15 #define OBD_TGT_SOFT 0x4
16
17
18 /* generic wrappable next */
19
20 #define NEXT_INDEX(index, max)                                  \
21         (((index + 1) >= max) ? 0 : (index + 1))
22
23
24 /* error codes */
25
26 enum obd_stat {
27  OBD_OK = 0,
28  OBDERR_PERM = 1, 
29  OBDERR_NOENT = 2,
30  OBDERR_IO = 5,
31  OBDERR_NXIO = 6,
32  OBDERR_ACCESS = 13,
33  OBDERR_EXIST = 17,
34  OBDERR_XDEV = 18, 
35  OBDERR_NODEV = 19,
36  OBDERR_INVAL = 22,
37  OBDERR_FBIG = 27,
38  OBDERR_NOSPC = 28,
39  OBDERR_ROFS = 30,
40  OBDERR_OPNOTSUPP = 45,
41  OBDERR_DQUOT = 69
42 };
43
44
45 extern struct rpc_program obd_program;
46
47
48 struct obd_target {
49         struct sockaddr_in tgt_addr;
50         int tgt_flags;
51         int tgt_timeo;
52         int tgt_retrans;
53         int tgt_hostnamelen;
54         char tgt_hostname[0];
55         
56 };
57
58
59 struct rpc_obd {
60         struct rpc_clnt *       handle;         /* RPC client handle */
61         struct sockaddr_in      addr;
62         int                     flags;          /* various flags */
63         int                     timeo;
64         int                     retrans;
65         int                     rsize;          /* read size */
66         int                     wsize;          /* write size */
67         unsigned int            bsize;          /* server block size */
68         char *                  hostname;       /* remote hostname */
69 };
70
71
72 #define OBD_PROGRAM             300001
73 #define OBD_VERSION             1
74 #define OBDPROC_NULL            0
75 #define OBDPROC_ECHOINT         1
76
77 #ifdef  OBD_NEED_XDR_TYPES
78
79 struct obd_echoint_in {
80         __u32                   in;
81 };
82
83 struct obd_echoint_out {
84         __u32                   out;
85 };
86
87
88 #endif /* OBD_NEED_XDR_TYPES */
89
90
91 int obd_proc_echoint(struct rpc_obd *target, __u32 in, __u32 *out);
92
93
94 #endif