Whamcloud - gitweb
forgotten two files
[fs/lustre-release.git] / lustre / include / linux / obd_osc.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * Data structures for object storage targets and client: OST & OSC's
22  * 
23  * See also lustre_idl.h for wire formats of requests.
24  *
25  */
26
27 #ifndef _LUSTRE_OST_H
28 #define _LUSTRE_OST_H
29
30 #include <linux/obd_support.h>
31
32 #define OST_EXIT 1
33 #define LUSTRE_OST_NAME "ost"
34
35 struct ost_obd {
36         struct obd_device *ost_tgt;
37         struct obd_conn ost_conn;
38         struct task_struct *ost_thread;
39         wait_queue_head_t ost_waitq;
40         wait_queue_head_t ost_done_waitq;
41         int ost_flags;
42         spinlock_t ost_lock;
43         struct list_head ost_reqs;
44 };
45
46 struct osc_obd {
47         struct obd_device *ost_tgt;
48 };
49
50 struct ost_request { 
51         struct list_head rq_list;
52         struct ost_obd *rq_obd;
53         int rq_status;
54
55         char *rq_reqbuf;
56         int rq_reqlen;
57         struct ost_req_hdr *rq_reqhdr;
58         struct ost_req *rq_req;
59
60         char *rq_repbuf;
61         int rq_replen;
62         struct ost_rep_hdr *rq_rephdr;
63         struct ost_rep *rq_rep;
64
65         void *rq_reply_handle;
66         wait_queue_head_t rq_wait_for_rep;
67 };
68
69 struct ost_req { 
70         __u32   connid;
71         __u32   cmd; 
72         struct obdo oa;
73         __u32   buflen1;
74         __u32   buflen2;
75         char *   buf1;
76         char *   buf2;
77 };
78
79 struct ost_rep {
80         __u32   result;
81         __u32   connid;
82         struct obdo oa;
83         __u32   buflen1;
84         __u32   buflen2;
85         char *   buf1;
86         char *   buf2;
87 };
88
89
90 /* ost/ost_pack.c */
91 int ost_pack_req(char *buf1, int buflen1, char *buf2, int buflen2, struct ost_req_hdr **hdr, struct ost_req **req, int *len, char **buf);
92 int ost_unpack_req(char *buf, int len, struct ost_req_hdr **hdr, struct ost_req **req);
93 int ost_pack_rep(void *buf1, __u32 buflen1, void *buf2, __u32 buflen2, struct ost_rep_hdr **hdr, struct ost_rep **rep, int *len, char **buf);
94 int ost_unpack_rep(char *buf, int len, struct ost_rep_hdr **hdr, struct ost_rep **rep);
95
96 #endif
97
98