Whamcloud - gitweb
- changed back to using no optimization for UML modules, and no -g2
[fs/lustre-release.git] / lustre / include / linux / obd_ost.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 #define LUSTRE_OSC_NAME "osc"
35
36 struct ost_obd {
37         struct obd_device *ost_tgt;
38         struct obd_conn ost_conn;
39         struct task_struct *ost_thread;
40         wait_queue_head_t ost_waitq;
41         wait_queue_head_t ost_done_waitq;
42         int ost_flags;
43         spinlock_t ost_lock;
44         struct list_head ost_reqs;
45
46         struct ptlrpc_service *ost_service;
47 };
48
49 struct ost_request { 
50         struct list_head rq_list;
51         struct ost_obd *rq_obd;
52         int rq_status;
53
54         char *rq_reqbuf;
55         int rq_reqlen;
56         struct ost_req_hdr *rq_reqhdr;
57         struct ost_req *rq_req;
58
59         char *rq_repbuf;
60         int rq_replen;
61         struct ost_rep_hdr *rq_rephdr;
62         struct ost_rep *rq_rep;
63
64         void *rq_reply_handle;
65         wait_queue_head_t rq_wait_for_rep;
66 };
67
68 /* ost/ost_pack.c */
69 int ost_pack_req(char *buf1, int buflen1, char *buf2, int buflen2, struct ptlreq_hdr **hdr, struct ost_req **req, int *len, char **buf);
70 int ost_unpack_req(char *buf, int len, struct ptlreq_hdr **hdr, struct ost_req **req);
71 int ost_pack_rep(void *buf1, __u32 buflen1, void *buf2, __u32 buflen2, struct ptlrep_hdr **hdr, struct ost_rep **rep, int *len, char **buf);
72 int ost_unpack_rep(char *buf, int len, struct ptlrep_hdr **hdr, struct ost_rep **rep);
73 void ost_pack_niobuf(void **tmp, void *addr, __u64 offset, __u32 len, 
74                    __u32 flags);
75 void ost_unpack_niobuf(void **tmp, struct niobuf **nbp);
76 void ost_pack_ioo(void **tmp, struct obdo *oa, int bufcnt);
77 void ost_unpack_ioo(void **tmp, struct obd_ioobj **ioop);
78 void *ost_req_buf2(struct ost_req *req);
79 void *ost_req_buf1(struct ost_req *req);
80 void *ost_rep_buf2(struct ost_rep *rep);
81 void *ost_rep_buf1(struct ost_rep *rep);
82
83
84
85 #endif
86
87