Whamcloud - gitweb
b=16098
[fs/lustre-release.git] / lustre / include / obd_ost.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see [sun.com URL with a
20  * copy of GPLv2].
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright  2008 Sun Microsystems, Inc. All rights reserved
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  *
36  * lustre/include/obd_ost.h
37  *
38  * Data structures for object storage targets and client: OST & OSC's
39  * 
40  * See also lustre_idl.h for wire formats of requests.
41  */
42
43 #ifndef _LUSTRE_OST_H
44 #define _LUSTRE_OST_H
45
46 #include <obd_class.h>
47
48 struct osc_brw_async_args {
49         struct obdo       *aa_oa;
50         int                aa_requested_nob;
51         int                aa_nio_count;
52         obd_count          aa_page_count;
53         int                aa_resends;
54         struct brw_page  **aa_ppga;
55         struct client_obd *aa_cli;
56         struct list_head   aa_oaps;
57 };
58
59 struct osc_async_args {
60         struct obd_info   *aa_oi;
61 };
62
63 struct osc_enqueue_args {
64         struct obd_export       *oa_exp;
65         struct obd_info         *oa_oi;
66         struct ldlm_enqueue_info*oa_ei;
67 };
68
69 int osc_extent_blocking_cb(struct ldlm_lock *lock,
70                            struct ldlm_lock_desc *new, void *data,
71                            int flag);
72
73 static inline struct ldlm_res_id *osc_build_res_name(__u64 id, __u64 gr,
74                                                      struct ldlm_res_id *name)
75 {
76         memset(name, 0, sizeof *name);
77         name->name[0] = id;
78         name->name[1] = gr;
79         return name;
80 }
81
82 static inline int osc_res_name_eq(__u64 id, __u64 gr, struct ldlm_res_id *name)
83 {
84         return name->name[0] == id && name->name[1] == gr;
85 }
86
87 #endif