Whamcloud - gitweb
- ext2_obd.c --- fix the bugs in read/write for Linux 2.4.3
[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
19
20 /* error codes */
21
22 enum obd_stat {
23  OBD_OK = 0,
24  OBDERR_PERM = 1, 
25  OBDERR_NOENT = 2,
26  OBDERR_IO = 5,
27  OBDERR_NXIO = 6,
28  OBDERR_ACCESS = 13,
29  OBDERR_EXIST = 17,
30  OBDERR_XDEV = 18, 
31  OBDERR_NODEV = 19,
32  OBDERR_INVAL = 22,
33  OBDERR_FBIG = 27,
34  OBDERR_NOSPC = 28,
35  OBDERR_ROFS = 30,
36  OBDERR_OPNOTSUPP = 45,
37  OBDERR_DQUOT = 69
38 };
39
40
41 extern struct rpc_program obd_program;
42
43
44 struct obd_target {
45         struct sockaddr_in tgt_addr;
46         int tgt_flags;
47         int tgt_timeo;
48         int tgt_retrans;
49         int tgt_hostnamelen;
50         char tgt_hostname[0];
51         
52 };
53
54
55 struct rpc_obd {
56         struct rpc_clnt *       handle;         /* RPC client handle */
57         struct sockaddr_in      addr;
58         int                     flags;          /* various flags */
59         int                     timeo;
60         int                     retrans;
61         int                     rsize;          /* read size */
62         int                     wsize;          /* write size */
63         unsigned int            bsize;          /* server block size */
64         char *                  hostname;       /* remote hostname */
65 };
66
67
68 #define OBD_PROGRAM             300001
69 #define OBD_VERSION             1
70 #define OBDPROC_NULL            0
71 #define OBDPROC_ECHOINT         1
72
73 #ifdef  OBD_NEED_XDR_TYPES
74
75 struct obd_echoint_in {
76         __u32                   in;
77 };
78
79 struct obd_echoint_out {
80         __u32                   out;
81 };
82
83
84 #endif /* OBD_NEED_XDR_TYPES */
85
86
87 int obd_proc_echoint(struct rpc_obd *target, __u32 in, __u32 *out);
88
89
90 #endif